-
Discrepancy between GA4 Data and Big Query Results for Users and Sessions
Alright, so here’s what I’m getting at. I’m whipping up a report that sorts stuff by medium and source, namely:
Total Users
Engaged Sessions
Engagement TimeI’ve managed to wrangle together a query that gives me some results. The thing is, once I pull these results into Looker, the comparison is like night and day – they’re totally different. You can see for yourself in this screenshot I’ve attached.
Wondering if anyone might have a clue as to why my GA4 data doesn’t match with my query? Below is the query I’m using for you tech-minded folks.WITH prep AS ( SELECT traffic_source.medium, traffic_source.source, event_date, user_pseudo_id, (SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id') AS ga_session_id, CONCAT(user_pseudo_id, (SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id')) AS session_id, (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'session_engaged') AS engaged_sessions, (SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'engagement_time_msec') AS engagement_time_msec FROM
nth-glider-369017.analytics_316822874.events_*
) SELECT COUNT(DISTINCT user_pseudo_id) AS users, COUNT(DISTINCT session_id) AS num_of_sessions, COUNT(DISTINCT CASE WHEN engaged_sessions = '1' THEN CONCAT(user_pseudo_id, CAST(ga_session_id AS STRING)) ELSE NULL END) AS num_of_engaged_sessions, AVG(engagement_time_msec) AS engagement_time_msec, event_date, medium, source FROM prep GROUP BY event_date, medium, source;
Log in to reply.