WebmasterID logoWebmasterID
Data quality

Event parameter unnesting in BigQuery

In the GA4 BigQuery export, event_params is an array of key/value records where the value lives in one of string_value, int_value, float_value, or double_value. Reading a parameter requires UNNEST plus a key filter, and doing it carelessly multiplies rows so event counts inflate. This page explains how to unnest event parameters correctly and why the wrong join over-counts.

Verified against primary sources

The nested shape

Each export row carries event_params as a REPEATED RECORD: every element has a key and a value struct, and the actual value sits in whichever typed field applies — string_value, int_value, float_value, or double_value. To read 'page_location' you UNNEST(event_params), filter to that key, and pick the right value field.

If you UNNEST without filtering to a single key, or join multiple unnests naively, each event row is duplicated once per parameter, so COUNT(*) over the result no longer counts events.

Unnesting without inflation

Use a scalar subquery to pull one parameter — (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_location') — so the event row stays single. Count distinct events on event-level keys (for example a concatenation of event_timestamp and the user pseudo id) rather than COUNT(*) after a join. Pick the value field that matches the parameter's type, or you read nulls.

This is a query-shape pitfall, separate from schema changes that rename or move a parameter.

How it appears in analytics and logs

An event count that balloons after adding a parameter to a query usually means an UNNEST join multiplied rows rather than the data growing.

Diagnostic use case

Extract GA4 event parameters from the BigQuery export without fanning out rows and inflating event or conversion counts.

What WebmasterID can help detect

WebmasterID exposes event properties without nested-array gymnastics, reducing the chance of an unnest mistake distorting counts.

Common mistakes

Privacy and accuracy notes

Parameters can hold sensitive values if instrumented poorly; review them before exposing. This page is educational, not legal advice.

Related pages

Sources and verification notes

Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.