我想通过自定义维度获取访问特定页面的用户数量。
但是我的代码与Google Analytics(分析)不匹配。谁能帮我这个?
SELECT
PARSE_DATE('%Y%m%d', t.date) as Date
,count(distinct( concat(fullVisitorID,cast(visitID as string)))) as visitor_count
,(if(customDimensions.index=1, customDimensions.value,null)) as orig
FROM `table` as t
CROSS JOIN UNNEST(hits) AS hit
CROSS JOIN UNNEST(hit.customDimensions) AS customDimensions
WHERE
(hit.page.pagePath ='apple'OR hit.page.pagepath= 'pear')
GROUP BY DATE,orig
非常感谢!!!!
最佳答案
没意识到我只需要计算FullvistorID,就解决了这个问题。希望这可以帮助某人。
SELECT
PARSE_DATE('%Y%m%d', t.date) as Date
,count(distinct(fullvisitorid)) as visitor_count
,(if(customDimensions.index=1, customDimensions.value,null)) as orig
FROM `table` as t
CROSS JOIN UNNEST(hits) AS hit
CROSS JOIN UNNEST(hit.customDimensions) AS customDimensions
WHERE
(hit.page.pagePath ='apple'OR hit.page.pagepath= 'pear')
GROUP BY DATE,orig
关于google-analytics - Google Big查询按页面路径和Google Analytics(分析)数据的自定义维度获取用户计数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48085339/