Kassia Oliveira
Kassia Oliveira

Reputation: 43

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

Result GA4

Result BQ = 37024

enter image description here

Upvotes: 0

Views: 864

Answers (2)

Ameet Wadhwani
Ameet Wadhwani

Reputation: 560

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/

Upvotes: 1

Michele Pisani
Michele Pisani

Reputation: 14179

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

Upvotes: 0

Related Questions