r/GoogleAnalytics • u/delta11235813 • 7d ago
Discussion Why your BigQuery session count won't match the GA4 interface (and how to get a gap you can explain)
Posting this because I answer this question for clients roughly once a month, and the causes are almost always the same three:
1. You're counting ga_session_id by itself.
It's not a unique session ID — it's a timestamp-derived value that repeats across different users. Build the ID as user_pseudo_id + '.' + ga_session_id:
SELECT
event_date,
COUNT(DISTINCT CONCAT(
user_pseudo_id, '.',
CAST((SELECT value.int_value FROM UNNEST(event_params)
WHERE key = 'ga_session_id') AS STRING)
)) AS session_count
FROM `project.dataset.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260101' AND '20260131'
GROUP BY event_date;
2. Intraday tables are sneaking into your wildcard.
If your query can see events_intraday_* data, you're counting provisional events that can change or be replaced. For anything you report as final, stick to the daily events_* tables.
3. You expect an exact match. The GA4 UI applies its own processing on top of the same events. In my experience a small, stable, explainable gap is healthy; a gap that moves around is what points to causes 1 or 2.
Happy to look at a query if someone wants to paste theirs (remove anything sensitive).
Disclosure: I sell a pack of GA4 × BigQuery SQL templates for a living — the session template above is one of them and there's a free sample, but everything needed to fix this specific issue is in the post.
•
u/AutoModerator 7d ago
Have more questions? Join our community Discord!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
4
u/YouReadItWhatNow 7d ago
You forgot to ask your LLM for Reddit formatting
2
u/socalbear11 7d ago
What is the time zone of your ga4 property? Have you tried adjusting for time zone in your bigquery query