Request a demo

GA4 in BigQuery · Working with the export

GA4 BigQuery export schema: tables, nested fields and value types

The GA4 export writes one table per day (events_YYYYMMDD) and, with streaming on, events_intraday_YYYYMMDD. Each row is one event. Parameters, user properties and items are repeated records you read with UNNEST. This query lists every event parameter and which value column holds it.

Runs on Google's public sample bigquery-public-data.ga4_obfuscated_sample_ecommerce · Scans 1.3 GiB, under $0.01 on-demand · Checked in November 2026

The query

-- Which event parameters exist, and which value column holds them
SELECT
  ep.key,
  COUNT(*)                                   AS events,
  COUNTIF(ep.value.string_value IS NOT NULL) AS string_values,
  COUNTIF(ep.value.int_value IS NOT NULL)    AS int_values,
  COUNTIF(ep.value.double_value IS NOT NULL) AS double_values,
  COUNTIF(ep.value.float_value IS NOT NULL)  AS float_values
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`,
  UNNEST(event_params) AS ep
GROUP BY ep.key
ORDER BY events DESC, ep.key;

Result on the sample

First rows
keyeventsstring_valuesint_valuesdouble_valuesfloat_values
ga_session_id42955840429558400
ga_session_number42955840429558400
page_location42955844295584000
page_title42761044274636000
engaged_session_event41162370411623700
session_engaged3996312368292131339100
debug_mode36829910368299100
page_referrer32065121127778000
all_data28281740000
clean_event28280402828040000

How it works

A GA4 property linked to BigQuery exports into a dataset named analytics_<property_id>. The daily export writes one table per day, events_YYYYMMDD. These are date-sharded tables, not one partitioned table, so you query a date range through the wildcard events_* and limit it with the _TABLE_SUFFIX pseudo-column. The streaming export adds events_intraday_YYYYMMDD, filled continuously during the day and deleted once that day's daily table is complete (see intraday tables).

Every row is one event. Flat columns hold the basics: event_date (STRING, YYYYMMDD), event_timestamp (INT64, microseconds since the epoch in UTC), event_name, user_pseudo_id and user_id. STRUCT columns group related fields, and you read them with a dot: device.category, geo.country, traffic_source.source, ecommerce.purchase_revenue_in_usd, privacy_info.analytics_storage. Three columns are repeated records (arrays of structs): event_params, user_properties and items. To read them you need UNNEST, usually inside a scalar subquery (see unnest event_params).

Each parameter's value is a STRUCT with four slots: string_value, int_value, double_value and float_value. Only one is filled per row, and which one depends on the type the tag sent. The result shows why that matters: in this sample session_engaged arrives as a string on 3,682,921 events and as an integer on 313,391. A query that reads only string_value silently drops the integer rows. Run this inventory once on your own export before you write reports against it.

Current exports have more columns than this sample, which dates from 2020 and 2021. Google's schema now also lists collected_traffic_source (UTM and click IDs collected with each event), session_traffic_source_last_click (the session's last-click campaign, grouped by ad platform), is_active_user, the batch_event_index, batch_page_id and batch_ordering_id ordering fields, and items.item_params. None of these exist in the sample, so the recipes in this cookbook avoid them in runnable SQL and mention them where they would change the answer.

ColumnMeaning
keyName of the event parameter, such as page_location or ga_session_id.
eventsEvents that carry this parameter.
string_values / int_values / double_values / float_valuesHow many of those events store the value in each slot. A parameter with counts in two slots needs COALESCE across both.

Notes and cost

  • Measured on the sample: 92 daily tables from events_20201101 to events_20210131, all with the same schema, 4,295,584 events and 3,583,657,854 bytes in total. No intraday tables, no partitioning. The busiest day is 2020-12-08 (92,199 events), the quietest 2020-12-25 (21,355).
  • What the columns cost: of the 3.34 GiB the sample holds, event_params is 1.31 GiB and items is 946.5 MiB. user_pseudo_id is 84.7 MiB, event_name 53.4 MiB. BigQuery bills the columns you reference, so user_pseudo_id plus event_name together cost about 4% of a SELECT *.
  • This inventory reads event_params.key and all four value slots for the whole sample: 1.31 GiB. The same query on one day costs 23.1 MiB (first variation), and one day is enough to see which slot each parameter uses.
  • event_date is the event's date in the property's reporting time zone; event_timestamp is UTC. Convert with TIMESTAMP_MICROS(event_timestamp) and a time zone before comparing hours with the GA4 interface.
  • Google keeps writing late events into a daily table for up to three days after its date, so yesterday's table can still grow. Reports that must match should use days older than 72 hours.
  • In the sample, user_id is NULL on every event and user_properties is effectively empty. Some parameters (all_data, gclid, dclid) exist only as keys with every value slot NULL: that is obfuscation, not something to expect in your own export.

Variations

Same inventory on one day

One daily table holds the same keys and types and scans a fraction of the bytes.

SELECT
  ep.key,
  COUNT(*)                                   AS events,
  COUNTIF(ep.value.string_value IS NOT NULL) AS string_values,
  COUNTIF(ep.value.int_value IS NOT NULL)    AS int_values,
  COUNTIF(ep.value.double_value IS NOT NULL) AS double_values
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`,
  UNNEST(event_params) AS ep
WHERE _TABLE_SUFFIX = '20201201'
GROUP BY ep.key
ORDER BY events DESC;

List every column and nested field path

INFORMATION_SCHEMA.COLUMN_FIELD_PATHS returns one row per field, nested ones included, with its type. It reads metadata, not the events: the dry run reports the 10 MB minimum.

SELECT
  field_path,
  data_type
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.INFORMATION_SCHEMA.COLUMN_FIELD_PATHS`
WHERE table_name = 'events_20210131';

Look at a few raw events as JSON

TO_JSON_STRING shows the nested layout of real rows. Filter by _TABLE_SUFFIX, because LIMIT alone does not reduce the bytes scanned.

SELECT
  event_name,
  TO_JSON_STRING(event_params) AS event_params,
  TO_JSON_STRING(items)        AS items
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`
WHERE _TABLE_SUFFIX = '20201201'
  AND event_name = 'purchase'
LIMIT 3;

FAQ

Is the GA4 BigQuery export a partitioned table?

No. It writes one table per day (events_YYYYMMDD), which BigQuery calls date-sharded tables. You select days with _TABLE_SUFFIX; a filter on event_date does not skip any table. If you want partitioning, copy the data into your own partitioned table (see daily summary table).

Why does each event parameter have four value columns?

Parameters can be strings, integers or decimals, and a repeated record needs one fixed schema. GA4 stores each value in the slot that matches the type sent: string_value, int_value or double_value. Google's schema describes float_value as not currently in use.

Where are session source and medium in the export?

Newer exports have session_traffic_source_last_click for the session's last-click campaign and collected_traffic_source for UTM values on each event. Older exports, including this sample, only have source, medium and campaign event parameters and the first-touch traffic_source record (see session source / medium).

What does the GA4 sample dataset contain?

Obfuscated export data from the Google Merchandise Store web stream, 2020-11-01 to 2021-01-31. Google notes that some fields hold placeholders such as <Other>, NULL or empty strings, and that its internal consistency is limited, so it does not match the GA4 demo account.

All GA4 export queries · BigQuery cost queries · The GA4 sample dataset

Cut BigQuery spend without guessing

Masthead attributes compute and storage cost to every project, user, pipeline and table, finds unused and dead-end tables, and shows where editions or on-demand pricing is cheaper. Mnemonic cut its BigQuery compute cost by 20% within 24 hours of onboarding.