Skip to content

Commit 4b2bb6e

Browse files
nrllhmgiffordkevinfarrugiatunetheweb
authored
CMS 2024 queries (#3731)
* Queries of CMS 2024 (replicated from 2022's version) * Update cms_adoption_by_geo.sql * Update cms_adoption_by_rank.sql * Update cms_adoption_by_region.sql * Update cms_adoption_by_subregion.sql * Update cms_adoption.sql * Update core_web_vitals_by_geo.sql * Update core_web_vitals_by_geo.sql * Update core_web_vitals_yoy.sql * Update core_web_vitals_yoy.sql * Update core_web_vitals_yoy.sql * Update image_format_popularity.sql * Update image_format_popularity.sql * Update lighthouse_category_scores_per_cms.sql * Update page_weight_distribution.sql * Update page_weight_distribution.sql Fixing linter issues. * Update page_weight_distribution.sql Fixing linting. * Update cms_adoption_by_geo.sql Fixing the linter errors. * Update cms_adoption_by_subregion.sql Linter errors * Update core_web_vitals_yoy.sql Fixing linter errors. * Update lighthouse_category_scores_per_cms.sql Fixing linter errors. * Update page_weight_distribution.sql removing white space. * Update cms_adoption.sql Fixing linting issues. * Update cms_adoption_by_geo.sql Fixing linting issues. * Update cms_adoption_by_rank.sql Fixing linting issues. * Update cms_adoption_by_region.sql Conforming with linter. * Update cms_adoption_by_subregion.sql Fixing linter errors * Update core_web_vitals_by_geo.sql Linting errors. * Update core_web_vitals_yoy.sql Fixing linting * Update image_format_popularity.sql Fixing linting * Update lighthouse_category_scores_per_cms.sql Updating for linting. * Update lighthouse_category_scores_per_cms.sql Linting... * Update image_format_popularity.sql Linting issues. * Update core_web_vitals_yoy.sql Linting * Update cms_adoption_by_subregion.sql Linting * Update cms_adoption_by_region.sql Linting * Update cms_adoption_by_geo.sql Linting * Update cms_adoption_by_subregion.sql Fixing whitespace issue * Update cms_adoption_by_rank.sql Whitespace * Update cms_adoption_by_geo.sql Spacing * Update lighthouse_category_scores_per_cms.sql spacing * Update image_format_popularity.sql Linting * Update cms_adoption_by_subregion.sql Linting.. * Update cms_adoption_by_region.sql Linting * Update cms_adoption_by_rank.sql spaces * Update cms_adoption_by_geo.sql Spaces * Update cms_adoption_by_region.sql Indenting spaces * Update core_web_vitals_yoy.sql Fixing Alias * Update resource_weights.sql * Update top_cms.sql * Update top_cms_by_geo.sql * Update top_cms_by_geo.sql * Update resource_weights.sql * Update top_cms_by_rank.sql * Update wordpress_page_builders.sql * Update wordpress_resources.sql * Update cms_adoption.sql * Update cms_adoption_by_geo.sql * Update cms_adoption_by_rank.sql * Update cms_adoption_by_region.sql * Update cms_adoption_by_subregion.sql * Update core_web_vitals_by_geo.sql * Update core_web_vitals_yoy.sql * Update core_web_vitals.sql * Update image_format_popularity.sql * Update lighthouse_category_scores_per_cms.sql * Update top_cms.sql * Update top_cms_by_geo.sql * Update top_cms_by_rank.sql * Update wordpress_page_builders.sql * Update wordpress_page_builders.sql * Fixed linting issues * Fixed linting issues * Added query for lighthouse scores per CMS YoY * Update sql/2024/cms/cms_adoption_by_rank.sql Co-authored-by: Barry Pollard <barrypollard@google.com> * Update sql/2024/cms/top_cms_by_rank.sql Co-authored-by: Barry Pollard <barrypollard@google.com> * Removed redundant query cms_adoption_by_rank.sql --------- Co-authored-by: Mike Gifford <mike.gifford@civicactions.com> Co-authored-by: Kevin Farrugia <hello@imkev.dev> Co-authored-by: Kevin Farrugia <kevinfarrugia@users.noreply.github.com> Co-authored-by: Barry Pollard <barrypollard@google.com>
1 parent 196c389 commit 4b2bb6e

17 files changed

Lines changed: 3145 additions & 0 deletions

sql/2024/cms/cms_adoption.sql

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#standardSQL
2+
# CMS adoption OVER time
3+
# cms_adoption.sql
4+
5+
SELECT
6+
client,
7+
2024 AS year,
8+
COUNT(DISTINCT page) AS freq,
9+
total,
10+
COUNT(DISTINCT page) / total AS pct
11+
FROM
12+
`httparchive.all.pages`,
13+
UNNEST(technologies) AS technologies,
14+
UNNEST(technologies.categories) AS cats
15+
JOIN (
16+
SELECT
17+
client,
18+
COUNT(0) AS total
19+
FROM
20+
`httparchive.all.pages`
21+
WHERE
22+
date = '2024-06-01' AND
23+
is_root_page
24+
GROUP BY
25+
client)
26+
USING
27+
(client)
28+
WHERE
29+
cats = 'CMS' AND
30+
date = '2024-06-01' AND
31+
is_root_page
32+
GROUP BY
33+
client,
34+
total
35+
UNION ALL
36+
SELECT
37+
client,
38+
2023 AS year,
39+
COUNT(DISTINCT page) AS freq,
40+
total,
41+
COUNT(DISTINCT page) / total AS pct
42+
FROM
43+
`httparchive.all.pages`,
44+
UNNEST(technologies) AS technologies,
45+
UNNEST(technologies.categories) AS cats
46+
JOIN (
47+
SELECT
48+
client,
49+
COUNT(0) AS total
50+
FROM
51+
`httparchive.all.pages`
52+
WHERE
53+
date = '2023-06-01' AND
54+
is_root_page
55+
GROUP BY
56+
client)
57+
USING
58+
(client)
59+
WHERE
60+
cats = 'CMS' AND
61+
date = '2023-06-01' AND
62+
is_root_page
63+
GROUP BY
64+
client,
65+
total
66+
UNION ALL
67+
SELECT
68+
client,
69+
2022 AS year,
70+
COUNT(DISTINCT page) AS freq,
71+
total,
72+
COUNT(DISTINCT page) / total AS pct
73+
FROM
74+
`httparchive.all.pages`,
75+
UNNEST(technologies) AS technologies,
76+
UNNEST(technologies.categories) AS cats
77+
JOIN (
78+
SELECT
79+
client,
80+
COUNT(0) AS total
81+
FROM
82+
`httparchive.all.pages`
83+
WHERE
84+
date = '2022-06-01' AND
85+
is_root_page
86+
GROUP BY
87+
client)
88+
USING
89+
(client)
90+
WHERE
91+
cats = 'CMS' AND
92+
date = '2022-06-01' AND
93+
is_root_page
94+
GROUP BY
95+
client,
96+
total
97+
ORDER BY
98+
year DESC,
99+
pct DESC
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#standardSQL
2+
# All CMS popularity per geo
3+
# cms_adoption_by_geo.sql
4+
5+
WITH geo_summary AS (
6+
SELECT
7+
`chrome-ux-report`.experimental.GET_COUNTRY(country_code) AS geo,
8+
IF(device = 'desktop', 'desktop', 'mobile') AS client,
9+
origin,
10+
COUNT(DISTINCT origin) OVER (PARTITION BY country_code, IF(device = 'desktop', 'desktop', 'mobile')) AS total
11+
FROM
12+
`chrome-ux-report.materialized.country_summary`
13+
WHERE
14+
yyyymm = 202406
15+
)
16+
17+
SELECT
18+
*
19+
FROM (
20+
SELECT
21+
client,
22+
geo,
23+
COUNT(0) AS pages,
24+
ANY_VALUE(total) AS total,
25+
COUNT(0) / ANY_VALUE(total) AS pct
26+
FROM (
27+
SELECT DISTINCT
28+
geo,
29+
client,
30+
total,
31+
CONCAT(origin, '/') AS page
32+
FROM
33+
geo_summary
34+
)
35+
JOIN (
36+
SELECT
37+
client,
38+
page
39+
FROM
40+
`httparchive.all.pages`,
41+
UNNEST(technologies) AS technologies,
42+
UNNEST(technologies.categories) AS cats
43+
WHERE
44+
date = '2024-06-01' AND
45+
cats = 'CMS' AND
46+
is_root_page
47+
)
48+
USING
49+
(client,
50+
page)
51+
GROUP BY
52+
client,
53+
geo)
54+
WHERE
55+
pages > 1000
56+
ORDER BY
57+
pages DESC

0 commit comments

Comments
 (0)