Skip to content

Commit

Permalink
Merge branch 'main' into cms-2024-markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb committed Nov 7, 2024
2 parents 76260cf + 4b2bb6e commit 5d1be91
Show file tree
Hide file tree
Showing 17 changed files with 3,145 additions and 0 deletions.
99 changes: 99 additions & 0 deletions sql/2024/cms/cms_adoption.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#standardSQL
# CMS adoption OVER time
# cms_adoption.sql

SELECT
client,
2024 AS year,
COUNT(DISTINCT page) AS freq,
total,
COUNT(DISTINCT page) / total AS pct
FROM
`httparchive.all.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
JOIN (
SELECT
client,
COUNT(0) AS total
FROM
`httparchive.all.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.all.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
JOIN (
SELECT
client,
COUNT(0) AS total
FROM
`httparchive.all.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.all.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
JOIN (
SELECT
client,
COUNT(0) AS total
FROM
`httparchive.all.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
ORDER BY
year DESC,
pct DESC
57 changes: 57 additions & 0 deletions sql/2024/cms/cms_adoption_by_geo.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#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 = 202406
)

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.all.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS cats
WHERE
date = '2024-06-01' AND
cats = 'CMS' AND
is_root_page
)
USING
(client,
page)
GROUP BY
client,
geo)
WHERE
pages > 1000
ORDER BY
pages DESC
Loading

0 comments on commit 5d1be91

Please sign in to comment.