The GA4 export schema: events, event_params, and items explained
The GA4 BigQuery schema holds one table per day and one row per event. Most of the detail sits in nested columns you must unnest. Read it by business question: each question maps to one field and one trap. On Google's public sample, January 2021 holds 1,210,147 rows, as our guide to the GA4 BigQuery export shows.
What does one row per event mean for your queries?
One row per event means every metric in the GA4 export is an aggregation you write yourself.
The GA4 BigQuery export is a Google Analytics 4 feature that writes every collected event, as one row, into a BigQuery dataset of your own Google Cloud project, without sampling, thresholds, or an "(other)" row, once a day or in streaming.
Each row carries an event_name, an event_timestamp in microseconds, and the user_pseudo_id that sent it. There is no session row, no user row, and no pageview row. A pageview is a row whose event_name is page_view. A session is a set of rows sharing one session key. On the public sample, January 2021 holds 1,210,147 event rows from 94,790 distinct user_pseudo_id values.
Three consequences follow for every query. First, COUNT(*) counts events, never visits or people. Second, almost every query needs a filter on event_name, because parameters repeat across event types. Third, each day is its own table, events_YYYYMMDD. A month is a wildcard query on events_*, bounded by _TABLE_SUFFIX. An unbounded wildcard reads every table of the dataset and bills every byte.
The definitions you choose, such as a session or an order, belong in one place. Counting GA4 sessions in BigQuery without getting it wrong runs three session definitions on the same rows.
Which flat fields answer a question without UNNEST?
Flat fields answer who, when, where, and on which device, and you read them as ordinary columns. Some are scalars, like event_date, event_name, and user_pseudo_id. Others are records read with a dot path, like device.category, geo.country, or traffic_source.medium. A record that is not repeated never multiplies rows. The query that follows counts what the identifier fields hold in January 2021.
SELECT
COUNT(*) AS event_rows,
COUNT(DISTINCT user_pseudo_id) AS distinct_user_pseudo_ids,
COUNTIF(user_id IS NOT NULL) AS rows_with_user_id,
COUNTIF(ARRAY_LENGTH(user_properties) > 0) AS rows_with_user_properties,
COUNTIF(device.category = 'mobile') AS mobile_rows
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20210101' AND '20210131'
| Measure | January 2021 |
|---|---|
| Event rows | 1,210,147 |
Distinct user_pseudo_id | 94,790 |
Rows with a user_id | 0 |
Rows with user_properties | 11 |
Rows with device.category = mobile | 477,266 |
Computed on 2026-10-15 on the public sample bigquery-public-data.ga4_obfuscated_sample_ecommerce (Google Merchandise Store, 2020-11-01 to 2021-01-31, obfuscated data).
The user_id field is empty on every sample row: it exists only if your site sends one. The user_pseudo_id field identifies a browser on a device, not a person. The event_date field is a string in the property's time zone. The event_timestamp field, by contrast, is in UTC. Mixing the two moves late-evening events to the wrong day. The device and geo records also describe the event, not the session. A session that switches networks can carry two cities. A session-level report then needs a rule, such as the first event.
traffic_source is the trap among flat fields. Google documents it as the campaign that first acquired the user. Its values never change afterwards, so it answers a recruitment question, not a session question. Traffic source in the GA4 export: four fields, one right answer per question sorts the four candidates.
How do you read event_params, items, and user_properties with UNNEST?
You read a nested field with UNNEST, either inside a correlated subquery or in a join.
An event parameter is a key-value pair stored in the repeated event_params column of an export row, which describes that one event (its page, its session identifier, its engagement) and must be read with UNNEST or a subquery because it is not a column of its own.
items and user_properties are repeated records too, with one entry per product or per user property. The two reading patterns behave differently. A correlated subquery returns one value per event row and keeps the row count intact. A join, written FROM events, UNNEST(event_params), returns one row per parameter. The join suits an inventory, the subquery suits a metric. The inventory that follows joins, and counts which typed field holds each value.
SELECT
ep.key AS param_key,
COUNT(*) AS occurrences,
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 OR ep.value.float_value IS NOT NULL) AS double_values
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`,
UNNEST(event_params) AS ep
WHERE _TABLE_SUFFIX BETWEEN '20210101' AND '20210131'
GROUP BY param_key
ORDER BY occurrences DESC
LIMIT 10
| Parameter key | Occurrences | string_value set | int_value set | double_value or float_value set |
|---|---|---|---|---|
ga_session_number | 1,210,147 | 0 | 1,210,147 | 0 |
ga_session_id | 1,210,147 | 0 | 1,210,147 | 0 |
page_location | 1,210,147 | 1,210,147 | 0 | 0 |
page_title | 1,202,594 | 1,202,232 | 0 | 0 |
engaged_session_event | 1,171,598 | 0 | 1,171,598 | 0 |
session_engaged | 1,113,643 | 1,004,641 | 109,002 | 0 |
debug_mode | 1,004,702 | 0 | 1,004,702 | 0 |
page_referrer | 964,706 | 327,573 | 0 | 0 |
Computed on 2026-10-15 on the public sample bigquery-public-data.ga4_obfuscated_sample_ecommerce (Google Merchandise Store, 2020-11-01 to 2021-01-31, obfuscated data). The query returns ten keys. The two not shown are engagement_time_msec (740,021, all integers) and medium (336,342, all strings).
Two readings matter. The session_engaged key is split across two typed fields. The page_referrer key is present on 964,706 rows but empty on 637,133 of them. A present key is not a filled value. No key in the top ten uses double_value or float_value. Google marks float_value as not currently in use.
Where are transactions and revenue: the ecommerce record and items?
Transactions and revenue sit in the ecommerce record, and products sit in the repeated items record. The ecommerce record is flat, with one value per event for each field. It holds transaction_id, purchase_revenue, tax_value, shipping_value, total_item_quantity, and unique_items. Google fills purchase_revenue on purchase events only, and refund_value on refund events only. The items record holds one entry per product. Each entry carries item_id, item_name, price, quantity, and item_revenue. The query that follows measures which events carry items in January 2021.
SELECT
event_name,
COUNT(*) AS events,
COUNTIF(ARRAY_LENGTH(items) > 0) AS events_with_items,
ROUND(100 * COUNTIF(ARRAY_LENGTH(items) > 0) / COUNT(*), 1) AS pct_with_items,
SUM(ARRAY_LENGTH(items)) AS item_rows_after_unnest
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20210101' AND '20210131'
GROUP BY ROLLUP(event_name)
HAVING events_with_items > 0
ORDER BY events_with_items DESC
LIMIT 12
| Event name | Events | Events with items | Share with items | Rows after UNNEST(items) |
|---|---|---|---|---|
| All events | 1,210,147 | 141,922 | 11.7% | 1,036,149 |
view_item | 86,971 | 60,750 | 69.9% | 683,311 |
view_promotion | 53,885 | 40,500 | 75.2% | 40,500 |
add_to_cart | 15,522 | 15,522 | 100.0% | 174,733 |
begin_checkout | 11,034 | 11,034 | 100.0% | 24,978 |
select_item | 10,229 | 10,229 | 100.0% | 107,043 |
select_promotion | 2,948 | 2,682 | 91.0% | 2,682 |
purchase | 1,204 | 1,204 | 100.0% | 2,890 |
Computed on 2026-10-15 on the public sample bigquery-public-data.ga4_obfuscated_sample_ecommerce (Google Merchandise Store, 2020-11-01 to 2021-01-31, obfuscated data). One more row, view_item_list, has items on 1 of 9 events, for 12 item rows.
The revenue trap follows from the join. Unnesting items turns 1,204 purchase events into 2,890 rows, about 2.4 per purchase. A sum of ecommerce.purchase_revenue after that join counts each order once per product line. Sum order revenue on unjoined rows, and item revenue on unnested rows, never both in one query. Count orders as distinct transaction_id values. The guide's counting query gives the January 2021 picture. There, 1,204 purchase events carry 894 distinct identifiers, and 300 events carry (not set). Which events fill items along the funnel is the subject of The GA4 e-commerce events that build the funnel, from view_item to purchase.
Which field answers which business question, and what is the trap?
Each business question maps to one field of the export, and one trap that silently changes the number. The table reads from left to right. Start from the question a stakeholder asks, never from the column list. Then check the trap before you trust the first result. Each trap is cheap to test with one query on one month. Each one also breaks quietly: the query runs, returns a plausible number, and nobody notices.
| Business question | Field to read | Trap |
|---|---|---|
| Where did this session come from? | session_traffic_source_last_click on recent exports; event_params keys source and medium on older ones | traffic_source is the user's first acquisition and never changes |
| How many sessions? | user_pseudo_id plus the event_params key ga_session_id | ga_session_id alone is not unique across users |
| Was the session engaged? | event_params key session_engaged | The value is split across string_value and int_value |
| Which pages were viewed? | event_params key page_location, on page_view rows | The key is on every event, so filter on event_name |
| How much revenue did orders bring? | ecommerce.purchase_revenue, on purchase rows | Summed after UNNEST(items), it counts once per product line |
| How many orders? | Distinct ecommerce.transaction_id | (not set) values and reloaded confirmation pages |
| Which products sold? | items.item_id, items.quantity, items.item_revenue on purchase rows | items is also filled on view_item and add_to_cart |
| Who is the customer? | user_pseudo_id; user_id only if your site sends one | One person on two devices is two user_pseudo_id values |
One trap from this table, measured on the sample: session_engaged is stored in two typed fields. The query that follows reads it from string_value only, then from both fields.
WITH flat AS (
SELECT
CONCAT(user_pseudo_id, '-', CAST((SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id') AS STRING)) AS session_key,
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'session_engaged') AS engaged_as_string,
(SELECT COALESCE(value.string_value, CAST(value.int_value AS STRING)) FROM UNNEST(event_params) WHERE key = 'session_engaged') AS engaged_any_type
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20210101' AND '20210131'
)
SELECT
COUNT(DISTINCT session_key) AS sessions,
COUNT(DISTINCT IF(engaged_as_string = '1', session_key, NULL)) AS engaged_string_only,
COUNT(DISTINCT IF(engaged_any_type = '1', session_key, NULL)) AS engaged_both_types
FROM flat
| Measure | January 2021 |
|---|---|
Sessions (user_pseudo_id + ga_session_id) | 118,380 |
Engaged sessions, string_value only | 107,433 |
| Engaged sessions, both typed fields | 111,119 |
Computed on 2026-10-15 on the public sample bigquery-public-data.ga4_obfuscated_sample_ecommerce (Google Merchandise Store, 2020-11-01 to 2021-01-31, obfuscated data).
Reading one typed field drops 3,686 engaged sessions, and no error message warns you. The fix is a COALESCE across typed fields, written once in a staging table. Every trap in the table deserves the same treatment. Write the check as a query that must return zero rows, and run it after each load.
What changes between events_ and events_intraday_ tables?
events_YYYYMMDD is the finished daily table, and events_intraday_YYYYMMDD is a same-day working copy.
An intraday table is a table of the GA4 export, named events_intraday_YYYYMMDD, that the streaming export fills during the day and that Google deletes once the daily table of that date is complete, so it never holds history and never replaces the daily table.
The intraday table exists only when streaming export is on, and sandbox projects never get one. Some fields stay empty in it. Google populates traffic_source, user_ltv, and is_active_user in daily tables only. The daily table is not final on the day it appears either. Google adds late-arriving events to it for up to three days after its date.
The wildcard is the trap. events_* matches both families, because both names start with events_. An unfiltered query can count the same day twice while both tables exist. A filter such as _TABLE_SUFFIX BETWEEN '20210101' AND '20210131' excludes intraday tables, whose suffix starts with intraday_. The public sample holds 92 daily tables and no intraday table, so its queries never meet the problem.
The working rule fits in one sentence. Model the daily tables, reload the last three days on every run, and keep intraday for same-day monitoring.
FAQ
What is the difference between event_params and user_properties?
Event parameters describe one event, such as its page or its session identifier. User properties describe the user, such as a loyalty tier your tag sets. A user property set once is carried on that user's later events, with a set_timestamp_micros field. On the public sample, only 11 of the 1,210,147 January 2021 rows carry any user property.
Is the GA4 export schema stable over time?
No, the GA4 export schema changes over time. Google adds fields, and new daily tables carry them while old tables keep their old schema. The 2021 public sample has no collected_traffic_source or session_traffic_source_last_click record. A wildcard query takes the schema of the newest matching table. A model written on an old export should be reviewed against the current schema page.
Which value field should I read for a custom parameter?
Read the field your tag fills, and check it before writing the model. Group the key by string_value, int_value, and double_value counts, as the inventory query does. On the sample, session_engaged arrives in two fields. When a key arrives in both, coalesce them into one typed column in a staging table.
Can I query the GA4 export without UNNEST?
Yes, you can query flat fields such as event_name, device.category, or geo.country without UNNEST. Every value stored in event_params, items, or user_properties needs UNNEST or a correlated subquery. The usual practice is a staging table that flattens the parameters you need once a day. Reports then read plain columns.
Keep the question table next to your models, and make every trap a test. The rest of the GA4 BigQuery export: the complete guide to raw event data covers sessions, users, and costs. Want new analyses like this one as they ship? Get new analyses as they ship.
Sources
- BigQuery export schema for Google Analytics 4 (opens in a new tab) - Google, consulted 2026-10-15
- Query multiple tables using a wildcard table (opens in a new tab) - Google Cloud, updated 2026-10-13, consulted 2026-10-15
- Work with arrays (opens in a new tab) - Google Cloud, updated 2026-10-13, consulted 2026-10-15