Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google analytics 可以在bigquery中获取google analytics事件时间戳吗?_Google Analytics_Google Cloud Platform_Google Bigquery_Google Cloud Storage - Fatal编程技术网

Google analytics 可以在bigquery中获取google analytics事件时间戳吗?

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

我试图从大查询(google analytics 360)中获取事件时间戳,但我似乎找不到正确的导出字段来获取它

我已经尝试了
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毫秒),这似乎很有效。