GA4 BigQuery Query Generator
Generate BigQuery SQL for your GA4 data
How It Works
Select your event and dimensions
Choose the GA4 event name and the dimensions you want to analyse.
Set date range and project details
Enter your GA4 BigQuery project/dataset and select the date range for your query.
Copy the SQL
Get ready-to-run BigQuery standard SQL that queries the correct GA4 table schema.
GA4 BigQuery Query Generator
Why GA4 Analysts Use BigQuery Instead of the GA4 UI
The GA4 UI is designed for marketers who need quick insights from pre-aggregated reports. But when you need to answer questions like "what is the exact sequence of events that leads to purchase?", the GA4 UI hits its limit. BigQuery gives you direct access to every individual event, every parameter value, and every user session — at the raw row level — with the full power of standard SQL. This GA4 BigQuery query generator produces syntactically correct BigQuery SQL handling the notoriously tricky UNNEST(event_params) syntax automatically.
Understanding the GA4 BigQuery Schema
- One row = one event. Every event fired by every user gets its own row. Events are not pre-aggregated — you count, sum, and group them yourself in SQL.
- event_params is a REPEATED RECORD. Each event can have many parameters, stored as an array of key-value structs. Use
UNNEST(event_params)to flatten it. - Values are typed. Each parameter value has four sub-fields: value.string_value, value.int_value, value.float_value, value.double_value.
- Wildcard tables for date ranges. Query multiple days with
events_*andWHERE _TABLE_SUFFIX BETWEEN '20240101' AND '20240131'.