---
title: "Sessionizing GA4 BigQuery Events: Three Session Definitions and When Each Is Right"
url: "https://samarthanalytics.com/blog/ga4-bigquery-sessionization-three-definitions"
published: "2026-07-15"
updated: "2026-11-04"
category: "Analytics Engineering"
tags: "dbt, BigQuery export, BigQuery, GA4, analytics engineering"
author: "Samarth Analytics"
---

# Sessionizing GA4 BigQuery Events: Three Session Definitions and When Each Is Right

> The GA4 BigQuery export contains events, not sessions. Every team that models the export has to decide what a session is, and most make that decision implicitly in the first query someone writes. This guide sets out three defensible session definitions - GA4's own, an inactivity-based rebuild, and a business definition for attribution work - when each one is right, and the edge cases that quietly break session counts.

## Why there is no sessions table

The GA4 export to BigQuery is a stream of events. Each row is one event - `page_view`, `add_to_cart`, `purchase` - with a timestamp, a pseudonymous user identifier, and a nested array of parameters. There is no sessions table, no session-level dimensions, and no session-level metrics. GA4's interface builds sessions on the fly; the export leaves that job to you.

That is a feature, not an omission. It means you can define a session in whatever way fits the question you are answering. It also means every team that models the export makes a definition decision, usually without noticing, in the first query someone writes. When finance's dashboard and marketing's dashboard disagree on session counts, the cause is often two different definitions that nobody wrote down. We argued for deciding the model first in [model your GA4 BigQuery export before you query it](https://samarthanalytics.com/blog/ga4-bigquery-export-model-first); this post is about the session layer specifically.

## Definition one: GA4's own session

Each event in the export carries a `ga_session_id` parameter. Combined with `user_pseudo_id`, it identifies the session GA4 itself assigned. Grouping events by that pair gives you sessions that match the interface's logic: a new session after thirty minutes of inactivity by default (or whatever timeout the property uses), no split at midnight, and no split when the campaign changes mid-visit.

This is the right definition for most reporting, because it keeps BigQuery numbers aligned with what stakeholders see in GA4. Expect a small gap rather than an exact match, because the interface estimates counts with an approximation algorithm rather than counting every distinct session. A gap of one or two percent is normal; a gap of ten percent means something in your query is wrong.

Its weakness is that it inherits every quirk of GA4's own sessionisation, and it cannot be applied to events that lack the parameter.

## Definition two: an inactivity-based rebuild

The second approach ignores `ga_session_id` and rebuilds sessions from timestamps: order each user's events by `event_timestamp`, start a new session whenever the gap since the previous event exceeds a threshold, and number the sessions with a running sum.

This is the right definition when you are combining GA4 events with other sources - server events sent through the Measurement Protocol, app events from another SDK, or offline touchpoints - that do not carry a GA4 session ID. It is also useful after identity stitching. Once you have merged several device identifiers into one known customer, GA4's per-device sessions no longer describe that customer's behaviour, and a rebuild across the merged timeline does. We covered the stitching itself in [identity resolution from anonymous to known](https://samarthanalytics.com/blog/identity-resolution-anonymous-to-known).

The cost is divergence from the interface. Rebuilt sessions will not match GA4's counts, so label them clearly and keep them out of reports that sit next to GA4 screenshots.

## Definition three: a business session for attribution

Attribution work sometimes needs a session that starts whenever the traffic source changes - the way Universal Analytics behaved. If a visitor arrives from a paid search ad, leaves, and returns twenty minutes later from an email, GA4 counts one session with the paid search source. An attribution model that wants to credit the email needs a second session.

A business session definition starts a new session on inactivity or on a change of source, medium or campaign, using the source information on each event's `collected_traffic_source` fields or the session's first page view. This is the right definition for multi-touch attribution, for comparisons against Universal Analytics history, and for questions such as "how many visits did email drive". It is the wrong definition for everyday reporting, because it inflates session counts relative to GA4.

> Note: Name each definition in the model itself - `sessions_ga4`, `sessions_30min`, `sessions_touch` - rather than calling all three "sessions". Ambiguous names are how two correct dashboards end up disagreeing.

## Session-level attributes: source, engagement and landing page

A session table is only useful once each session carries attributes, and this is where definitions diverge further. Three attributes matter most:

1. Traffic source. Newer exports include session-level traffic source fields that reflect GA4's own attribution of the session. Older tables, and rebuilt sessions, need the source taken from the first event in the session that carries campaign information. Decide which rule you use and apply it consistently, because "first event" and "first page view" are not always the same event.
2. Engagement. GA4 marks engaged sessions with a `session_engaged` parameter and records `engagement_time_msec` on events. For GA4-defined sessions, read those values; for rebuilt sessions, recompute engagement from the same rule GA4 uses - ten seconds or more, a key event, or two or more page views - so engagement rate means the same thing across models.
3. Landing page. Take the `page_location` of the first `page_view` in the session, stripped of tracking parameters, rather than the first event of any type. Otherwise sessions that begin with a scroll or a click event report a blank landing page.

These choices belong in the same model description as the session definition itself. Two sessions tables with identical keys but different source rules will still produce different channel reports.

## Edge cases that break every definition

Whichever definition you choose, the same edge cases appear:

1. Events with no `user_pseudo_id`. When consent is denied and the property uses Consent Mode, cookieless events arrive without a user identifier. They cannot be sessionised at all; count them separately rather than letting them collapse into one giant null session.
2. Time zones. `event_date` is in the property's time zone, while `event_timestamp` is in UTC microseconds. Mixing them puts late-evening sessions on the wrong day.
3. Intraday and late-arriving events. The daily table can receive events for several days after the date it covers. Rebuilding sessions incrementally needs a look-back window, not just yesterday's partition.
4. Sessions spanning tables. A session that starts at 23:50 continues into the next day's table. Queries limited to a single date shard cut it in half.
5. Missing `session_start`. Not every session in the export has a `session_start` event, so counting that event as a proxy for sessions undercounts. Count distinct session keys instead.

## Choosing, documenting and testing

Our default is simple: build `sessions_ga4` as the primary session model, because it reconciles with the interface, and add the other definitions only when a specific use case needs them. Document each definition in the model description with the reason it exists and the reports that use it. Then add tests: session keys must be unique, every session must have at least one event, and the daily count of GA4-defined sessions must stay within a tolerance of the interface's count. The modelling patterns in [GA4 to dbt: sessions and events](https://samarthanalytics.com/blog/ga4-to-dbt-sessions-events-modeling) show how these fit into a dbt project, and [partitioning and clustering](https://samarthanalytics.com/blog/bigquery-partitioning-clustering-marketing) keeps the incremental rebuilds affordable.

## Final thoughts

A session is not a fact in the GA4 export; it is a definition you choose. GA4's own definition keeps you aligned with the interface, an inactivity rebuild handles merged and multi-source data, and a business definition serves attribution. Choose deliberately, name each one, and test them, and the most common source of "why don't these numbers match" disappears.

If you want a sessions layer built properly from the start, our [analytics engineering](https://samarthanalytics.com/services/analytics-engineering) team does exactly this, and a [free audit](https://samarthanalytics.com/free-audit) will tell you how your current queries define a session.

---

Published by [Samarth Analytics](https://samarthanalytics.com) (admin@samarthanalytics.com). More: [Blog](https://samarthanalytics.com/blog), [Guides](https://samarthanalytics.com/guides).
