sql - 如何在 BigQuery 中构建报告的热门转化路径
问题描述
我在 Google Analytics(分析)中构建类似“Top Conversion Paths”之类的报告时遇到问题。有什么想法可以创建这个吗?
我找到了类似的东西,但它不起作用(https://lastclick.city/top-conversion-paths-in-ga-and-bigquery.html):
SELECT
REGEXP_REPLACE(touchpointPath, 'Conversion >.*', 'Conversion') as touchpointPath, COUNT(touchpointPath) AS TOP
FROM (SELECT
GROUP_CONCAT(touchpoint,' > ') AS touchpointPath
FROM (SELECT
*
FROM (SELECT
fullVisitorId,
'Conversion' AS touchpoint,
(visitStartTime+hits.time) AS timestamp
FROM
TABLE_DATE_RANGE([pro-tracker-id.ga_sessions_], TIMESTAMP('2018-10-01'), TIMESTAMP('2018-10-05'))
WHERE
hits.eventInfo.eventAction="Email Submission success")
,
(SELECT
fullVisitorId,
CONCAT(trafficSource.source,'/',trafficSource.medium) AS touchpoint,
(visitStartTime+hits.time) AS timestamp
FROM
TABLE_DATE_RANGE([pro-tracker-id.ga_sessions_], TIMESTAMP('2018-10-01'), TIMESTAMP('2018-10-05'))
WHERE
hits.hitNumber=1)
ORDER BY
timestamp)
GROUP BY
fullVisitorId
HAVING
touchpointPath LIKE '%Conversion%')
GROUP BY
touchpointPath
ORDER BY
TOP DESC
解决方案
它不起作用,因为您必须根据需要修改查询。
需要更改此行以匹配您的特定事件操作:
hits.eventInfo.eventAction="YOUR EVENT ACTION HERE")
表格参考和日期也需要更改:
TABLE_DATE_RANGE([pro-tracker-id.ga_sessions_], TIMESTAMP('2018-10-01'), TIMESTAMP('2018-10-05'))
推荐阅读
- python - 滚动时间窗口上的熊猫`value_counts`
- c# - C# mailkit imap idle reconnect connection reset by peer
- vba - 将注释从 Word 导出到 Excel
- html - 如何找到具有特定值的跨度标签,然后找到它所在的父标签?
- python-3.x - 如何用分类代码替换列中多个逗号分隔的文本词
- java - 更新表时触发 Guava 缓存刷新
- javascript - 在nodejs中将音频从url转换为base64?
- android - android XML id 的最大字符长度是多少?
- c# - 使用 C# 推荐的数据库结构和检索
- c# - 如何使用 Activator.CreateInstance 自动生成实例名称?