How are nested GA4 event parameters read in BigQuery?

The Citead team, updated

In short. Use UNNEST(event_params) to read each parameter key, then select the matching typed field inside value.

Definition: In the GA4 BigQuery export, event_params is a repeated RECORD containing one parameter element for each key associated with an event. Each element exposes the parameter name through key and its typed value through the fields inside value.

Key facts

  • Google's BigQuery Export schema describes event_params as a repeated record for each key associated with an event.
  • The same schema says that the parameter set is unique to each implementation and can contain campaign-level, contextual and user-defined event parameters.
  • Google's BigQuery query guide uses UNNEST(event_params) to list parameter keys and count their occurrences.
  • The schema defines key as a STRING, value as a RECORD, and the value fields as string_value, int_value, double_value and float_value.

What is nested inside event_params?

The export keeps parameters inside the event row. Google documents event_params as a repeated RECORD, with one element for each key associated with an event. The record can hold campaign-level and contextual parameters together with user-defined parameters. Google also says that the set of parameters is unique to each implementation, so the available keys depend on the events that an implementation sends.

Each repeated element has two relevant levels. event_params.key is the parameter name. event_params.value is a record containing that parameter's value. The schema table gives STRING as the type for key and RECORD as the type for value in Google's export schema.

How does UNNEST read one parameter element?

BigQuery's UNNEST operator turns an array into rows. The Analytics query guide applies it to event_params, aliases each resulting element as EP, selects EP.key, and counts the occurrences for each key. This pattern reads the repeated record one element at a time.

The guide's event parameter list uses this shape:

SELECT
  EP.key AS event_param_key,
  COUNT(*) AS occurrences
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`,
  UNNEST(event_params) AS EP
GROUP BY event_param_key
ORDER BY event_param_key ASC;

The same guide also uses a scalar subquery with UNNEST(event_params) and WHERE key = 'value' to read a selected parameter from each purchase event. Google's basic query examples describe that query as returning the event timestamp and associated event parameter values.

Which typed field should a query select?

The value record has a separate field for each documented representation. Google says to use string_value when the parameter is represented by a string, with a URL or campaign name as examples. An integer uses int_value, and a double uses double_value. The schema also lists float_value and marks that field as currently unused.

For a query that inspects one key, select the branch that matches the parameter's representation:

SELECT
  ep.key,
  ep.value.string_value,
  ep.value.int_value,
  ep.value.double_value,
  ep.value.float_value
FROM `project.dataset.events_*`,
  UNNEST(event_params) AS ep
WHERE ep.key = 'page_location';

Google's examples use COALESCE(value.int_value, value.float_value, value.double_value) for the numeric value event parameter. A string parameter is read from value.string_value, as shown by the guide's GetParamString function, while an integer parameter is read from value.int_value by its GetParamInt function.

FAQ

Do I use UNNEST for every event parameter query?

Use UNNEST(event_params) when a query needs to inspect the repeated parameter elements. Google's examples use it both to list keys across a dataset and inside a scalar subquery that returns one selected parameter value.

Which field contains a URL parameter?

Read the parameter from value.string_value when the parameter is represented by a string. Google's schema uses a URL as an example of a string parameter.

Why can a typed value field be empty?

The schema defines separate value fields for strings, integers, doubles and floats. A query should read the field that matches the parameter representation; Google marks float_value as currently unused.

Sources

  1. Google Analytics Help, "BigQuery Export schema", undated
  2. Google for Developers, "Basic queries for Google Analytics event data export", 15 June 2026

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark