简体   繁体   中英

Results within Bigquery do not remain the same as in GA4

I'm inside BigQuery performing the query below to see how many users I had from August 1st to August 14th, but the number is not matching what GA4 presents me.

with event AS (
  SELECT
    user_id,
    event_name,
    PARSE_DATE('%Y%m%d',
      event_date) AS event_date,
    TIMESTAMP_MICROS(event_timestamp) AS event_timestamp,
    ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY TIMESTAMP_MICROS(event_timestamp) DESC) AS rn,
    
  FROM
    `events_*`
  WHERE
   event_name= 'push_received')
   
SELECT  COUNT ( DISTINCT user_id)
FROM
  event
WHERE
event_date >= '2022-08-01'

Resultado do GA4

结果 GA4

Result BQ = 37024

在此处输入图像描述

There are quite a few reasons why your GA4 data in the web will not match when compared to the BigQuery export and the Data API.

In this case, I believe you are running into the Time Zone issue. event_date is the date that the event was logged in the registered timezone of your Property. However, event_timestamp is a time in UTC that the event was logged by the client.

To resolve this, simply update your query with:

EXTRACT(DATETIME FROM TIMESTAMP_MICROS(`event_timestamp`) at TIME ZONE 'TIMEZONE OF YOUR PROPERTY' )

Your data should then match the WebUI and the GA4 Data API. This post that I co-authored goes into more detail on this and other reasons why your data doesn't match: https://analyticscanvas.com/3-reasons-your-ga4-data-doesnt-match/

You cannot simply compare totals. Divide it into daily comparisons and look at details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM