Total Sessions in BigQuery vs Google Analytics Reports

后端 未结 3 1087
情歌与酒
情歌与酒 2020-12-01 15:16

I\'m just learning BigQuery so this might be a dumb question, but we want to get some statistics there and one of those is the total sessions in a given day.

To do s

3条回答
  •  自闭症患者
    2020-12-01 15:30

    After posting the question we got into contact with Google support and found that in Google Analytics only sessions that had an "event" being fired are actually counted.

    In Bigquery you will find all sessions regardless whether they had an interaction or not.

    In order to find the same result as in GA, you should filter by sessions with totals.visits = 1 in your BQ query (totals.visits is 1 only for sessions that had an event being fired).

    That is:

    select sum(sessions) as total_sessions from (
      select
        fullvisitorid,
        count(distinct visitid) as sessions,
        from (table_query([40663402], 'timestamp(right(table_id,8)) between timestamp("20150519") and timestamp("20150519")'))
        where totals.visits = 1
        group each by fullvisitorid
    )
    

提交回复
热议问题