Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 161 additions & 0 deletions sql/2025/cms/cms_adoption.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
#standardSQL
# CMS adoption OVER time
# cms_adoption.sql

SELECT
client,
2025 AS year,
COUNT(DISTINCT page) AS freq,
total,
COUNT(DISTINCT page) / total AS pct
FROM
`httparchive.crawl.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
JOIN (
SELECT
client,
COUNT(0) AS total
FROM
`httparchive.crawl.pages`
WHERE
date = '2025-07-01' AND
is_root_page
GROUP BY
client
)
USING (client)
WHERE
cats = 'CMS' AND
date = '2025-07-01' AND
is_root_page
GROUP BY
client,
total
UNION ALL
SELECT
client,
2024 AS year,
COUNT(DISTINCT page) AS freq,
total,
COUNT(DISTINCT page) / total AS pct
FROM
`httparchive.crawl.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
JOIN (
SELECT
client,
COUNT(0) AS total
FROM
`httparchive.crawl.pages`
WHERE
date = '2024-06-01' AND
is_root_page
GROUP BY
client
)
USING (client)
WHERE
cats = 'CMS' AND
date = '2024-06-01' AND
is_root_page
GROUP BY
client,
total
UNION ALL
SELECT
client,
2023 AS year,
COUNT(DISTINCT page) AS freq,
total,
COUNT(DISTINCT page) / total AS pct
FROM
`httparchive.crawl.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
JOIN (
SELECT
client,
COUNT(0) AS total
FROM
`httparchive.crawl.pages`
WHERE
date = '2023-06-01' AND
is_root_page
GROUP BY
client
)
USING (client)
WHERE
cats = 'CMS' AND
date = '2023-06-01' AND
is_root_page
GROUP BY
client,
total
UNION ALL
SELECT
client,
2022 AS year,
COUNT(DISTINCT page) AS freq,
total,
COUNT(DISTINCT page) / total AS pct
FROM
`httparchive.crawl.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
JOIN (
SELECT
client,
COUNT(0) AS total
FROM
`httparchive.crawl.pages`
WHERE
date = '2022-06-01' AND
is_root_page
GROUP BY
client
)
USING (client)
WHERE
cats = 'CMS' AND
date = '2022-06-01' AND
is_root_page
GROUP BY
client,
total
UNION ALL
SELECT
client,
2021 AS year,
COUNT(DISTINCT page) AS freq,
total,
COUNT(DISTINCT page) / total AS pct
FROM
`httparchive.crawl.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
JOIN (
SELECT
client,
COUNT(0) AS total
FROM
`httparchive.crawl.pages`
WHERE
date = '2021-07-01' AND
is_root_page
GROUP BY
client
)
USING (client)
WHERE
cats = 'CMS' AND
date = '2021-07-01' AND
is_root_page
GROUP BY
client,
total
ORDER BY
year DESC,
pct DESC
56 changes: 56 additions & 0 deletions sql/2025/cms/cms_adoption_by_geo.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#standardSQL
# All CMS popularity per geo
# cms_adoption_by_geo.sql

WITH geo_summary AS (
SELECT
`chrome-ux-report`.experimental.GET_COUNTRY(country_code) AS geo,
IF(device = 'desktop', 'desktop', 'mobile') AS client,
origin,
COUNT(DISTINCT origin) OVER (PARTITION BY country_code, IF(device = 'desktop', 'desktop', 'mobile')) AS total
FROM
`chrome-ux-report.materialized.country_summary`
WHERE
yyyymm = 202507
)

SELECT
*
FROM (
SELECT
client,
geo,
COUNT(0) AS pages,
ANY_VALUE(total) AS total,
COUNT(0) / ANY_VALUE(total) AS pct
FROM (
SELECT DISTINCT
geo,
client,
total,
CONCAT(origin, '/') AS page
FROM
geo_summary
)
JOIN (
SELECT
client,
page
FROM
`httparchive.crawl.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
WHERE
date = '2025-07-01' AND
cats = 'CMS' AND
is_root_page
)
USING (client, page)
GROUP BY
client,
geo
)
WHERE
pages > 1000
ORDER BY
pages DESC
51 changes: 51 additions & 0 deletions sql/2025/cms/cms_adoption_by_rank_all.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#standardSQL
# CMS adoption per rank
SELECT
client,
rank_grouping,
CASE rank_grouping
WHEN 1e8 THEN 'all'
ELSE TRIM(CAST(rank_grouping AS STRING FORMAT '99,999,999'))
END AS rank_grouping_text,
COUNT(DISTINCT page) AS pages,
MAX(total) AS total,
COUNT(DISTINCT page) / MAX(total) AS pct
FROM (
SELECT
client,
page,
rank_grouping
FROM
`httparchive.crawl.pages`,
UNNEST(technologies) AS tech,
UNNEST(tech.categories) AS category,
UNNEST([1e3, 1e4, 1e5, 1e6, 1e7, 1e8]) AS rank_grouping
WHERE
date = '2025-07-01' AND
rank <= rank_grouping AND
is_root_page AND
category = 'CMS'
)
JOIN (
SELECT
client,
rank_grouping,
COUNT(0) AS total
FROM
`httparchive.crawl.pages`,
UNNEST([1e3, 1e4, 1e5, 1e6, 1e7, 1e8]) AS rank_grouping
WHERE
date = '2025-07-01' AND
rank <= rank_grouping AND
is_root_page
GROUP BY
client,
rank_grouping
)
USING (client, rank_grouping)
GROUP BY
client,
rank_grouping
ORDER BY
rank_grouping,
pages DESC
Loading