diff --git a/sql/2024/01/embed-blocks-on-root-and-non-root-pages.sql b/sql/2024/01/embed-blocks-on-root-and-non-root-pages.sql new file mode 100644 index 0000000..029939f --- /dev/null +++ b/sql/2024/01/embed-blocks-on-root-and-non-root-pages.sql @@ -0,0 +1,33 @@ +# HTTP Archive query to get scripts blocking in head, counted by plugin. +# +# WPP Research, Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# See query results here: https://github.com/GoogleChromeLabs/wpp-research/pull/84 + +SELECT + is_root_page, + JSON_EXTRACT(custom_metrics, '$.cms.wordpress.has_embed_block') AS has_embed_block, + COUNT(*) AS page_count, + ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER (), 1) AS percentage_of_total +FROM + `httparchive.all.pages`, + UNNEST(technologies) AS technology +WHERE + date = CAST('2023-12-01' AS DATE) + AND technology.technology = 'WordPress' +GROUP BY + has_embed_block, + is_root_page +ORDER BY percentage_of_total DESC diff --git a/sql/README.md b/sql/README.md index 79ce83c..a45bfe9 100644 --- a/sql/README.md +++ b/sql/README.md @@ -23,6 +23,7 @@ For additional considerations for writing BigQuery queries against HTTP Archive, ### 2024/01 * [TTFB of localized WordPress sites](./2024/01/ttfb-localized-sites.sql) +* [Embed blocks on root and non-root pages](./2024/01/embed-blocks-on-root-and-non-root-pages.sql) ### 2023/10