【发布时间】:2017-02-01 10:26:21
【问题描述】:
我正在统计在我们的主页上提交邮政编码的所有访问者。我在旧版 SQL 中提出了以下查询:
SELECT fullVisitorId, visitStartTime
FROM TABLE_DATE_RANGE([ga_sessions_], TIMESTAMP('2017-01-29'), CURRENT_TIMESTAMP())
where hits.page.pagePath = '/broadband/'
and visitStartTime > 1483228800
and hits.type = 'EVENT'
and hits.eventInfo.eventCategory = 'Homepage'
and hits.eventInfo.eventAction = 'Submit Postcode';
然后我想将它转换为标准 SQL 以在 CTE 中使用,并想出了一个看起来不正确的 SQL。
SELECT fullVisitorId, visitStartTime
FROM ``ga_sessions_*``, UNNEST(hits) as h
where
_TABLE_SUFFIX > '2017-01-29'
AND h.page.pagePath = '/broadband/'
and visitStartTime > 1483228800
and h.type = 'EVENT'
and h.eventInfo.eventCategory = 'Homepage'
and h.eventInfo.eventAction = 'Submit Postcode';
第一个处理 327 MB 并返回 4117 个结果,第二个处理 6.98 GB 并返回 60745 个结果。
我查看了migration guide,但事实证明它对我没有多大帮助。
ga_sessions 有 standard schema 的 GA 导入 Bigquery。
【问题讨论】:
标签: google-analytics google-bigquery