File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # standardSQL
2+ -- Gradient adoption in CSS variables over time (by year + client, no rank)
3+ -- Detects any "gradient(" inside custom_metrics.css_variables
4+ SELECT
5+ EXTRACT(YEAR FROM date ) AS year,
6+ client,
7+ COUNT (DISTINCT page) AS total_sites,
8+ COUNT (DISTINCT IF(
9+ REGEXP_CONTAINS(TO_JSON_STRING(custom_metrics .css_variables ), r' (?i)gradient\( ' ),
10+ page, NULL
11+ )) AS sites_using_gradient,
12+ SAFE_DIVIDE(
13+ COUNT (DISTINCT IF(
14+ REGEXP_CONTAINS(TO_JSON_STRING(custom_metrics .css_variables ), r' (?i)gradient\( ' ),
15+ page, NULL
16+ )),
17+ COUNT (DISTINCT page)
18+ ) AS pct_sites_using_gradient
19+ FROM ` httparchive.crawl.pages`
20+ WHERE
21+ is_root_page
22+ AND date IN (
23+ DATE ' 2019-07-01' ,
24+ DATE ' 2020-08-01' ,
25+ DATE ' 2021-07-01' ,
26+ DATE ' 2022-07-01' , -- CSS parsed-data exception (July)
27+ DATE ' 2024-06-01' ,
28+ DATE ' 2025-07-01'
29+ )
30+ GROUP BY year, client
31+ ORDER BY year, client;
You can’t perform that action at this time.
0 commit comments