Google analytics 可以在bigquery中获取google analytics事件时间戳吗?
我试图从大查询(google analytics 360)中获取事件时间戳,但我似乎找不到正确的导出字段来获取它 我已经尝试了Google analytics 可以在bigquery中获取google analytics事件时间戳吗?,google-analytics,google-cloud-platform,google-bigquery,google-cloud-storage,Google Analytics,Google Cloud Platform,Google Bigquery,Google Cloud Storage,我试图从大查询(google analytics 360)中获取事件时间戳,但我似乎找不到正确的导出字段来获取它 我已经尝试了hits.eventInfo.timestamp和hits.eventInfo.datetime,但它们似乎都不起作用 我的问题是 SELECT hits.eventInfo.timestamp as purchaseDate, fullVisitorId as visitorId FROM (tables) WHERE LOWER(hits.e
hits.eventInfo.timestamp
和hits.eventInfo.datetime
,但它们似乎都不起作用
我的问题是
SELECT
hits.eventInfo.timestamp as purchaseDate,
fullVisitorId as visitorId
FROM (tables)
WHERE LOWER(hits.eventInfo.eventAction) == 'purchase'
GROUP BY 2
ORDER BY 1 DESC
没有hit timestamp字段,但是您可以根据hits.time和visitStartTime计算它。有一排是从 hits.time INTEGER注册此命中时,访问开始时间后的毫秒数。第一次命中的hits.time为0
DATE\u ADD(时间戳(格式为UTC\u USEC(visitStartTime*1000000)),(hits.time/1000),“秒”)
这将返回UTC格式的YYYY-MM-DD HH:MM:SS
希望能有所帮助。如果您使用的是BigQuery的标准SQL
DATETIME\u ADD(DATETIME(TIMESTAMP\u SECONDS(t.visitStartTime)),INTERVAL h.time毫秒),这似乎很有效。