![](/img/trans.png)
[英]Google Big Query Get User Count by page path and Custom Dimension for Google Analytics Data
[英]Combine user level and page in Big Query
我開始探索大查詢,我想知道,是否可以將大查詢或 GA 數量的唯一用戶和他們看到的頁面結合起來? 所以我想看看有多少獨立訪問者瀏覽了一個或多個頁面,其中 Z% 還瀏覽了 W 個頁面?
我使用下面的查詢來獲取查看某些頁面的 Y 個唯一訪問者,但無法看到查看過 W 個頁面的百分比。
#standardSQL
SELECT
hits.page.pagePath AS other_seen_pages,
COUNT(hits.page.pagePath) AS number_other_seen_pages
FROM `project.dataset.session`,UNNEST(hits) AS hits
WHERE fullVisitorId IN (
SELECT fullVisitorId
FROM `project.dataset.session`,UNNEST(hits) AS hits
WHERE hits.page.pagePath LIKE '%x_page%'
GROUP BY fullVisitorId )
AND hits.page.pagePath IS NOT NULL
AND hits.page.pagePath NOT LIKE '%x_page%'
GROUP BY other_seen_pages
ORDER BY number_other_seen_pages DESC;
我知道您想要查詢,在相同訪問者訪問的其他頁面的頂部顯示訪問他們的訪問者數量(來自同一訪問者子集)(以及高於用戶總數的百分比)。
這是一些對我bigquery-public-data.google_analytics_sample.ga_sessions_20170801
代碼,用於bigquery-public-data.google_analytics_sample.ga_sessions_20170801
Google Analytics 公共表和“/google+redesign/electronics”頁面路徑:
它:
.
WITH
t_total_users as (select count(DISTINCT fullVisitorId) as total_users from `bigquery-public-data.google_analytics_sample.ga_sessions_20170801`),
t_other_pages as (SELECT
hits.page.pagePath AS other_seen_pages,
COUNT(hits.page.pagePath) AS number_other_seen_pages,
COUNT(DISTINCT fullvisitorID) as visitors_per_page
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_20170801`, UNNEST(hits) AS hits
WHERE fullVisitorId IN (
SELECT fullVisitorId
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_20170801`,UNNEST(hits) AS hits
WHERE hits.page.pagePath LIKE '/google+redesign/electronics'
GROUP BY fullVisitorId )
AND hits.page.pagePath IS NOT NULL
AND hits.page.pagePath NOT LIKE '/google+redesign/electronics'
GROUP BY other_seen_pages
ORDER BY number_other_seen_pages DESC)
SELECT
t_other_pages.other_seen_pages,
t_other_pages.number_other_seen_pages,
t_other_pages.visitors_per_page,
t_total_users.total_users,
(t_other_pages.visitors_per_page/t_total_users.total_users)*100 as percentage_visitants
FROM t_total_users, t_other_pages
如果查詢目標中有我誤解的內容,請說明!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.