google-analytics - Google Big查询按页面路径和Google Analytics(分析)数据的自定义维度获取用户计数

标签 google-analytics google-bigquery

我想通过自定义维度获取访问特定页面的用户数量。
但是我的代码与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/

相关文章:

google-analytics - 应用电子商务操作过滤器时,Big Query 和 Google Analytics UI 不匹配

google-bigquery - 如何使用 Google App Script 调用 Google Big Query 非遗留 SQL?

google-analytics - 新的“gtag.js” AdWords转化跟踪代码对现有UA设置的影响

ruby-on-rails - 访问 Garb Gem 结果

google-analytics - 为什么 Avg。 Google Analytics 上的页面加载时间为零?

sql - 非常简单的 BigQuery SQL 脚本不会为没有结果的计数行返回 "0"

google-analytics - Google CSE(自定义搜索引擎)如何将查询设置为 GA(Google Analytics)

google-analytics - 如何删除/隐藏与特定页面关联的所有 Google Analytics 数据?

sql - 使用嵌套和重复字段获取最新的列值

google-bigquery - BigQuery - 日期时间与时间戳