Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Last active June 28, 2024 09:56
Show Gist options
  • Save jdevalk/d4ae38001139f128dd65914cf03bd207 to your computer and use it in GitHub Desktop.
Save jdevalk/d4ae38001139f128dd65914cf03bd207 to your computer and use it in GitHub Desktop.
WITH site_cms AS (
SELECT
url,
COALESCE(
MAX(IF(category = 'CMS', app, NULL)),
MAX(IF(category = 'Ecommerce' AND app != 'Cart Functionality', app, NULL)),
'Unrecognized'
) AS cms_name
FROM
`httparchive.technologies.2024_05_01_mobile`
GROUP BY
url
)
SELECT
cms_name,
COUNT(*) AS count,
ROUND( 100 * ( COUNT(*) / SUM(COUNT(*)) OVER() ), 2 ) AS market_share
FROM
site_cms
GROUP BY
cms_name
ORDER BY
count DESC
LIMIT 100
WITH site_builder AS (
SELECT
url,
COALESCE(
MAX(IF(category = 'Page builders', app, NULL)),
'Unrecognized'
) AS builder_name
FROM
`httparchive.technologies.2024_05_01_mobile`
GROUP BY
url
)
SELECT
builder_name,
COUNT(*) AS count,
ROUND( 100 * ( COUNT(*) / SUM(COUNT(*)) OVER() ), 2 ) AS market_share
FROM
site_builder
GROUP BY
builder_name
ORDER BY
count DESC
LIMIT 100
WITH site_plugin AS (
SELECT
url,
COALESCE(
MAX(IF(category = 'WordPress plugins' AND app IN ('All in One SEO Pack', 'RankMath SEO', 'Slim SEO', 'The SEO Framework', 'Yoast SEO'), app, NULL)),
'Unrecognized'
) AS plugin_name
FROM
`httparchive.technologies.2024_05_01_mobile`
GROUP BY
url
)
SELECT
plugin_name,
COUNT(*) AS count,
ROUND( 100 * ( COUNT(*) / SUM(COUNT(*)) OVER() ), 2 ) AS market_share
FROM
site_plugin
GROUP BY
plugin_name
ORDER BY
count DESC
LIMIT 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment