Skip to content

Commit

Permalink
Add query for the counts of embed blocks on root and non-root pages
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Feb 1, 2024
1 parent bcbefb4 commit 83fdb99
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions sql/2024/01/embed-blocks-on-root-and-non-root-pages.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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.

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
1 change: 1 addition & 0 deletions sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 83fdb99

Please sign in to comment.