-
-
Notifications
You must be signed in to change notification settings - Fork 209
Expand file tree
/
Copy pathcms_adoption_by_geo.sql
More file actions
56 lines (54 loc) · 1.05 KB
/
cms_adoption_by_geo.sql
File metadata and controls
56 lines (54 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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