计算Google-Bigquery中的唯一事件 [英] Calculating Unique events in Google-Bigquery

查看:121
本文介绍了计算Google-Bigquery中的唯一事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到大查询中唯一事件的计数?我很难计算唯一事件的计数并将其与GA接口匹配。

解决方案

两种方式如何使用:1)正如原始链接文档所说,要结合完整的访问者用户ID和他们不同的会话ID:visitId并计算这些ID。



  SELECT 
EXACT_COUNT_DISTINCT(combinedVisitorId)
FROM(
SELECT
CONCAT(fullVisitorId,string( VisitId))AS combinedVisitorId
FROM
[google.com:analytics-bigquery:LondonCycleHelmet.ga_sessions_20130910]
WHERE
hits.type ='PAGE')
code>

2)另一种方法是统计不同的fullVisitorIds

  SELECT 
EXACT_COUNT_DISTINCT(fullVisitorId)
FROM
[google.com:analytics-bigquery:LondonCycleHelmet.ga_sessions_20130910]
WHERE
hits.type = 'PAGE'


How can one find the count of unique events in Big Query ? I am having a hard time calculating the count of Unique events and matching it with GA interface.

解决方案

two ways how this is used:

1) One is as the original linked documentation says, to combine full visitor user id, and their different session id: visitId, and count those.

SELECT
  EXACT_COUNT_DISTINCT(combinedVisitorId)
FROM (
  SELECT
    CONCAT(fullVisitorId,string(VisitId)) AS combinedVisitorId
  FROM
    [google.com:analytics-bigquery:LondonCycleHelmet.ga_sessions_20130910]
  WHERE
    hits.type='PAGE' )

2) The other is just counting distinct fullVisitorIds

SELECT
  EXACT_COUNT_DISTINCT(fullVisitorId)
FROM
  [google.com:analytics-bigquery:LondonCycleHelmet.ga_sessions_20130910]
WHERE
  hits.type='PAGE'

这篇关于计算Google-Bigquery中的唯一事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆