WebmasterID logoWebmasterID
UTM tracking

UTM parameters in BigQuery

When GA4 is linked to BigQuery, campaign data arrives in the event export as nested event_params and traffic-source fields. The UTM-derived values — source, medium, campaign, content, term — are queryable with SQL via UNNEST, letting you build custom attribution beyond the GA4 UI. This page covers where UTM-derived fields live in the BigQuery schema and the basic query shape.

Verified against primary sources

Where UTM-derived fields live

In the GA4 BigQuery export, traffic-source information appears in fields such as traffic_source and collected_traffic_source, and campaign details are also present in event_params for relevant events. The keys mirror the UTM mapping: source, medium, campaign, content, term.

Because event_params is a repeated record, you query a specific key with UNNEST and a filter on the key name.

A basic query shape

To pull campaign for an event, UNNEST event_params and select the value where key = 'campaign' (or the relevant key). Aggregate by source and medium for a custom acquisition report.

Watch for nulls: not every event carries every campaign key, so coalesce against the session traffic-source fields when building first-touch attribution.

How it appears in analytics and logs

In the BigQuery export, UTM-derived values appear in the session/traffic-source fields and event_params. A campaign missing from a query usually means the wrong key was UNNESTed or the value sits in collected_traffic_source rather than the event_params you queried.

Diagnostic use case

Query campaign attribution directly in BigQuery from the GA4 export, building custom source/medium/campaign reports or joins that the GA4 interface does not offer.

What WebmasterID can help detect

WebmasterID's server-side UTM capture can be exported and joined alongside a warehouse dataset, giving a campaign view that does not depend solely on the GA4 client export pipeline.

Common mistakes

Privacy and accuracy notes

The BigQuery export contains campaign fields that describe links, not identities. Visitor-level fields are governed by your GA4 consent and export configuration; UTMs add no personal data beyond the campaign labels.

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.