Skip to content
All field notes
Measurement
Published
Nov 5, 2026
Reading time
13 min read

GA4 vs BigQuery Sessions: Reconcile the Counting Rules

Diagnose GA4 and BigQuery session differences with a scoped SQL audit, missing-ID checks, mature export dates, consent evidence and reporting controls.

AP
AdProof Research
Independent measurement desk
A report sheet and export ledger with different row groupings are compared under a magnifying glass beside a tray of blank identity tags labeled Unknown.
Reconcile the population and counting rule before comparing totals. Conceptual illustration without measured customer data.
In this guide (11 sections)

GA4 sessions and a BigQuery session query can differ because they do not necessarily count the same population using the same method. Start with mature daily export tables, the same property and dates, a documented session key and an explicit treatment of missing identifiers. Then inspect reporting identity and modeled data. Do not change tracking merely to make two totals agree.

A real analytics question describes the confusing pattern: a low-traffic page nearly reconciles, the whole site does not, and some exported events lack session identifiers. The question was posted in January 2025, with a visible substantive reply in September 2025. It is an older unresolved operational question, not evidence of a new outage.

A separate Google Analytics Community question, posted in September 2026, describes consent-denied observations and null identifiers. These reports establish reader problems. They do not prove that either site's implementation, consent manager or export is defective.

Define what each number actually counts#

Write the comparison in one sentence before opening SQL: “For this property, these streams and these completed dates, compare this named report metric with this exported-data calculation.” Include the report's filters and identity setting.

NumberWhat it establishesWhat it does not establish
Exported event rowsRecords present in the selected tablesVisits, unique people or completed purchases
session_start rowsOccurrences of that event in the selected dataA guaranteed one-to-one match with reported Sessions
Distinct usable identifier pairsObserved pairs under your chosen key and date scopeAll sessions, including observations without that key
GA4 SessionsThe named metric in the selected reporting surfaceA promise that an arbitrary SQL query returns the same result

Google's session documentation explains that ga_session_id is generated from a session's start time in seconds. Pair it with an appropriate user identifier for external analysis; the session ID alone is not a property-wide unique key. The documentation also distinguishes automatically tagged events from Measurement Protocol and Data Import, which do not automatically include that identifier.

Use the same contract throughout the investigation. Replacing user_pseudo_id with user_id halfway through changes the identity population. Removing rows without a key changes coverage. Neither is a neutral formatting adjustment.

Related guide

Trace collection before reconciling the export.

If an expected event is missing upstream, inspect the request destination, consent and reporting path before changing the session query.

Trace the GA4 collection path

Opens a practical guide. No email required.

Freeze an export window that can be compared#

Start with an older completed period, rather than today's evolving tables. Google's BigQuery export guide recommends daily tables for a stable daily dataset. Streaming is best effort and can contain gaps; its intraday table is deleted when the corresponding daily table is complete.

Record the table names, query time and property time zone. Do not combine daily and intraday rows for the same date simply because both tables are visible. If your reporting pipeline replaces provisional data with daily data, test that replacement rather than appending the same activity twice.

The export schema reference documents ordinary late updates to daily tables for up to three days after the event date. An operational comparison should therefore declare its maturity policy. A historical data set can still be reprocessed in exceptional circumstances; preserve the query result and retrieval time instead of assuming a past number is immutable.

If a daily table is absent, investigate export configuration and its actual availability first. A query that scans fewer dates than the report is already comparing different populations. Do not conceal the missing day by averaging the other days.

Run a coverage audit before a session total#

The following GoogleSQL template separates event rows, start markers, usable pairs and missing keys. It is an original diagnostic example using documented fields, not a query run against an AdProof customer or a guaranteed reproduction of GA4 Sessions.

Replace the project, dataset and dates. The example dates are deliberately historical. It includes all exported streams in the dataset; apply the same stream restrictions as the report if you narrow it. Use your normal query-cost controls and preview the bytes to be processed before execution. First run the event-grain presence and repeated-key diagnostic below: this scalar extraction fails if an event has more than one matching session-ID parameter. Investigate those rows before running the coverage audit.

WITH base AS (
  SELECT
    event_name,
    user_pseudo_id,
    privacy_info.analytics_storage AS analytics_storage,
    (
      SELECT value.int_value
      FROM UNNEST(event_params)
      WHERE key = 'ga_session_id'
    ) AS ga_session_id
  FROM `YOUR_PROJECT.YOUR_DATASET.events_*`
  WHERE _TABLE_SUFFIX BETWEEN '20261020' AND '20261022'
), identifiable_pairs AS (
  SELECT
    user_pseudo_id,
    ga_session_id,
    COUNTIF(event_name = 'session_start') > 0 AS start_row_present
  FROM base
  WHERE user_pseudo_id IS NOT NULL
    AND ga_session_id IS NOT NULL
  GROUP BY user_pseudo_id, ga_session_id
)
SELECT
  COUNT(*) AS exported_event_rows,
  COUNTIF(event_name = 'session_start') AS session_start_rows,
  COUNTIF(
    user_pseudo_id IS NULL OR ga_session_id IS NULL
  ) AS rows_missing_session_key,
  COUNTIF(analytics_storage = 'No') AS analytics_storage_no_rows,
  (SELECT COUNT(*) FROM identifiable_pairs)
    AS identifiable_pairs_with_activity,
  (SELECT COUNTIF(start_row_present) FROM identifiable_pairs)
    AS identifiable_pairs_with_start_row
FROM base;

Google's query cookbook documents date restriction with _TABLE_SUFFIX and extraction from the repeated event_params record. The numeric suffix range here selects daily tables, rather than the intraday_ suffixes. Check the actual schema before adapting an older query.

The pair calculation groups two columns directly, avoiding an undocumented concatenation convention. If your data contains repeated session-ID parameters in one event, the scalar subquery can fail; inspect that condition rather than adding an arbitrary first-value rule to suppress it.

Read the output without changing its units#

identifiable_pairs_with_activity counts pairs appearing in the selected event tables. It can include a session that began before the selected period. identifiable_pairs_with_start_row narrows that set to pairs with an observed start marker inside the scanned tables. It can miss sessions whose start event is absent from that exported subset.

Keep both labels. A query over activity dates is not automatically a query over session-start dates, and an observed marker is not a replacement for every reporting rule. Google's UI-to-export explanation specifically cautions about date boundaries and double-counting sessions by summing daily distinct counts.

For example, one identifiable session that crosses midnight can appear in two daily activity tables. Deduplicating each day and adding the results counts that pair twice. Deduplicating the pair across the chosen range counts it once. State which operation your downstream dashboard performs.

Use the missing-key count as an event-row coverage measure. It is not the number of people who rejected consent, sessions lost, bots detected or paid clicks wasted. Repeated events from one journey can contribute many rows.

Check session-parameter presence at event grain#

A Stack Overflow question from October 2019 asks which exported events lack ga_session_id. The author unnests event_params and filters for a different key, then sees far more rows than in the original table. An answer proposes counting distinct timestamps. Google's current export schema says multiple events can share a timestamp, so that proposed shortcut can merge distinct events. The original does not establish a current incident or a verified unique event identifier.

The reason for the inflated count is the unit of the query. Google's array documentation explains that UNNEST returns one row for each array element. An event with ga_session_id and three other parameters has three rows satisfying key != 'ga_session_id'; it is not three events without a session ID. An empty parameter array also needs explicit treatment. EXISTS tests whether at least one element matches while retaining the parent event row.

The following read-only diagnostic template has not been run against a property. Replace the project and dataset and provide numeric daily suffix bounds as strings. Review the estimated scan cost and access controls before running it. It counts exported event rows, not people or sessions:

WITH selected_events AS (
  SELECT event_name, event_params
  FROM `PROJECT_ID.DATASET_ID.events_*`
  WHERE _TABLE_SUFFIX BETWEEN @start_suffix AND @end_suffix
)
SELECT
  event_name,
  COUNT(*) AS exported_event_rows,
  COUNTIF(EXISTS(
    SELECT 1 FROM UNNEST(event_params) AS p
    WHERE p.key = 'ga_session_id'
  )) AS rows_with_key,
  COUNTIF(NOT EXISTS(
    SELECT 1 FROM UNNEST(event_params) AS p
    WHERE p.key = 'ga_session_id'
  )) AS rows_without_key,
  COUNTIF((
    SELECT COUNT(*) FROM UNNEST(event_params) AS p
    WHERE p.key = 'ga_session_id'
  ) > 1) AS rows_with_repeated_key
FROM selected_events
GROUP BY event_name
ORDER BY exported_event_rows DESC;

For each event-name group, the first two presence categories partition the scanned parent rows. An empty or null array falls in the no-key category; a repeated key is counted once as present and also flagged separately. Presence does not prove a usable session identifier: a matching key may have a null, unexpected type or value. Check the actual value and repeated-key cases before applying the earlier scalar extraction. The pair-based session calculation also needs a usable user identifier, which this presence test does not assess.

As a simple constructed check, consider three event rows: one contains a session key plus two other parameters, one contains only another parameter, and one has an empty array. The query reports three event rows, one with the key and two without it. Flattening and filtering != would instead return three parameter rows, including two from the event that does contain the key. This illustration is not property data. Keep the original rows and query version for a reviewer; do not use DISTINCT event_timestamp to repair an expanded result or assume a combination of event fields is universally unique.

Investigate missing keys as a separate branch#

Break the missing-key rows down by date, event name, stream and available consent state. Compare those slices with the usable-key population. Look for a specific release, event source or collection route, rather than assigning every null to one cause.

The schema describes privacy_info.analytics_storage values as Yes, No or Unset. Keep those groups separate and preserve nulls if your query exposes them. Do not translate Unset into an affirmative choice, or turn an event-level proportion into a visitor consent rate.

Google documents that cookieless observations can be included in the export. Its behavioral-modeling guidance explains why observations without a persistent identifier do not establish how many individual people produced them. A null session key alone is therefore insufficient to identify either a consent implementation defect or invalid traffic.

If one event source lacks identifiers even in an authorized, consented test, inspect that integration's documented session parameters and collection sequence. When requests appear successful but the receiving data is missing, use the separate request-to-report diagnostic. Do not invent identifiers or weaken a visitor's choice to improve the reconciliation.

Align the reporting surface before interpreting the remainder#

Record whether you are reading a standard report, an Exploration, the Data API or a separate dashboard. Save its selected metric, dates, comparisons and data-quality messages. Then distinguish three questions:

  1. Did the export contain the selected records?
  2. Did the query count those records under the declared rule?
  3. Does the reporting surface apply an additional calculation or population?

Current reporting identity documentation distinguishes Blended, Observed and Device based. Record the actual setting instead of assuming it from an old tutorial. Changing reporting identity changes reporting interpretation, not collection; preserve the original setting before an authorized diagnostic comparison.

Behavioral modeling requires eligibility and sufficient evidence. Its estimates are not exported as matching raw rows. Check the report's indicator before citing modeling as the explanation. “Consent mode is installed” does not establish that a particular total contains modeled sessions.

Google also documents HLL++ approximation for cardinality metrics. Exact SQL distinct counts and an estimated reporting total can differ. Approximation is a mechanism to consider after population checks, not a universal acceptable-gap percentage or an explanation for any large difference.

Do not add page-level session rows into a site total#

A session can visit more than one page. Google's developer session guide distinguishes sessions associated with a visited page from sessions starting on a landing page. One journey can belong to several page-path rows while remaining one property-level session.

This explains why a single page can appear to reconcile while a manually summed site table does not. Inspect the total's aggregation rule before changing tags. Use a landing-page dimension when the question concerns where a session started; use a visited-page population when it concerns exposure to that page.

Avoid joining each event to several campaign, item or page rows and then counting the expanded result as if it retained the original grain. Check row counts before and after the join. Deduplicating an accidentally expanded table can conceal a modeling mistake without resolving it.

A hypothetical investigation with a useful stopping point#

Suppose a retailer reviews three mature daily tables containing 10,000 event rows. Of those, 2,200 lack at least one key component. The remaining 7,800 rows contain 1,200 distinct identifiable pairs with activity, of which 1,150 have an observed start marker in the period. GA4's selected report shows 1,260 Sessions.

These numbers are invented to demonstrate interpretation. The missing-key share is 2,200 / 10,000 = 22% of exported event rows. The report-to-activity-pair difference is (1,260 - 1,200) / 1,200 = 5%, using identifiable pairs as the denominator. Neither percentage measures lost sessions or invalid traffic.

The 50-pair difference between activity and observed-start cohorts deserves a boundary check. The missing-key rows deserve source and consent analysis. The 60-count report difference deserves a documented reporting comparison. Those are separate investigations; adding 2,200 to 1,200 would combine events with pairs and produce a meaningless total.

A bounded conclusion might be: “The warehouse query correctly counts identifiable pairs with activity in this export window. Some observations cannot be assigned that key, and the selected report has a different calculation contract. No evidence yet identifies a collection defect.” That is more useful than declaring one system universally correct.

Keep a reconciliation packet someone else can repeat#

Save the property and streams, reporting time zone, completed dates, table inventory, query version, retrieval time, report settings, missing-key groups and unresolved hypotheses. Repeat the same contract after a demonstrated correction; do not select a new denominator merely because it looks closer.

Maintain three independent checks: export availability, query logic and report interpretation. The tracking QA checklist covers the collection journey that precedes them; the platform comparison guide covers attribution and business-outcome reconciliation beyond this warehouse task.

For a separate campaign-delivery question, the anonymized fashion retail counting study concerns ad impressions, not GA4 session reconstruction. Bring a defined ad-delivery population and the reports being reconciled to AdProof to discuss the supported measurement workflow. Keep event collection, reported attribution and billed delivery distinct.

Frequently asked questions#

Should BigQuery sessions always be higher than GA4?

No universal ordering follows from these sources. Export maturity, missing keys, identity, reporting calculations and query scope can affect the comparison. Define both populations before interpreting which total is larger.

Can I count only session_start events to reproduce Sessions?

That produces an event count for the selected data. Compare it with identifiable pairs and investigate missing markers, date boundaries and reporting rules. Do not rename it GA4 Sessions without establishing that the comparison is valid.

Can I count each row with a null session ID as another session?

No. A missing key leaves an event unassigned under that calculation. Several such events may belong to one journey, and the export may not contain the evidence needed to reconstruct it. Preserve the unassigned population separately.

Will switching reporting identity repair missing exported events?

It does not change collection. Record the setting and use any authorized reporting comparison to test a hypothesis, while investigating missing export dates or collection failures through their own evidence. It is not a method for recovering absent historical records.

Your next step

Trace collection before reconciling the export.

If an expected event is missing upstream, inspect the request destination, consent and reporting path before changing the session query.

Trace the GA4 collection path

Opens a practical guide. No email required.

Back to all field notes