希望从我们的GA 360导出中获取对访问者的平均延迟跟踪。
设置以下查询,但得到以下错误,并且我不确定为什么,因为所有这些都是聚合函数:SELECT列表表达式引用hits.latencyTracking.serverResponseTime,它既不在[3:5]也未分组或聚合
select
TIMESTAMP_SECONDS(visitStartTime) as visitStartTime,
AVG(hits.latencyTracking.serverResponseTime) OVER (PARTITION BY visitid) as avgServerResponseTime,
AVG(hits.latencyTracking.serverConnectionTime) OVER (PARTITION BY visitid) as avgServerConnectionTime,
AVG(hits.latencyTracking.domInteractiveTime) OVER (PARTITION BY visitid) as avgdomInteractiveTime,
AVG(hits.latencyTracking.pageLoadTime) OVER (PARTITION BY visitid) as avgpageLoadTime
from `xxx.xxx.ga_sessions_2018*`,
UNNEST(hits) AS hits
where hits.latencyTracking.serverResponseTime is not null
group by visitStartTime
最佳答案
查询的编写方式-AVG()不仅是Aggregate Function
,而且是Aggregate Analytic Function
。
要使其正常工作,您可以删除OVER(),以便AVG()真正成为此处对应于GROUP BY的聚合函数
select
TIMESTAMP_SECONDS(visitStartTime) as visitStartTime,
AVG(hits.latencyTracking.serverResponseTime) as avgServerResponseTime,
AVG(hits.latencyTracking.serverConnectionTime) as avgServerConnectionTime,
AVG(hits.latencyTracking.domInteractiveTime) as avgdomInteractiveTime,
AVG(hits.latencyTracking.pageLoadTime) as avgpageLoadTime
from `xxx.xxx.ga_sessions_2018*`,
UNNEST(hits) AS hits
where hits.latencyTracking.serverResponseTime is not null
group by visitStartTime
关于google-analytics - GA360访问ID上的平均Analytics(分析)功能,用于LatencyTracking,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51767798/