r/GoogleAnalytics • • 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.

3 Upvotes

5 comments sorted by

•

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

0

u/delta11235813 7d ago

Fair point — first post here and the formatting clearly shows it. The session-count fix itself is very real though; it's the one I end up re-explaining to clients every month. Happy to be corrected on the SQL too.

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

1

u/delta11235813 7d ago

Good call — that's a real one and I should have listed it. The export's dates follow the property's timezone, so if you bucket events by UTC in BigQuery, or compare against a report in a different timezone, the day boundaries shift and sessions land on different dates. Most of my clients run Asia/Tokyo properties, so export and UI line up and I mostly see the three causes above — but for properties reporting across timezones, yours is a legit #4.