• This thread is just the tip of the iceberg.The people ahead of the curve aren't Googling for answers — they're already in here, having the conversations you haven't found yet. DealerRefresh is free.Get the full picture →

BigQuery | ASC Events | Custom Definitions Schema

Hi, for anyone with a similar question, the custom definitions set in GA4 will come through to the BigQuery export in the event_params field.

To extract these you can use a query like below, where you have a sub-query within the main query that extracts the specified parameter from the event_params - just update the name_of_parameter below with the custom definition you wish to extract.

SELECT
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'name_of_parameter')
FROM `<project>.<dataset>.<table>`

For more info, I've found this guide really useful: extracting ga4 event parameters in bigquery
 
Hi, for anyone with a similar question, the custom definitions set in GA4 will come through to the BigQuery export in the event_params field.

To extract these you can use a query like below, where you have a sub-query within the main query that extracts the specified parameter from the event_params - just update the name_of_parameter below with the custom definition you wish to extract.

SELECT
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'name_of_parameter')
FROM `<project>.<dataset>.<table>`

For more info, I've found this guide really useful: extracting ga4 event parameters in bigquery
It's not actually the custom definitions from GA4 being pushed into the event_params field; it's whatever was being pushed into GA4 is being sent to BigQuery. Even if you don't have an attribute setup as a custom dimension or metric in GA4, it will still be available in BigQuery.

Also keep in mind that event parameters are not always strings. For example, in the ASC specification, the vehicle year is pushed as an integer, so the way that would be queried is like this:

(SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'item_year') AS vehicle_year,

int_value versus string_value. There's also other data types as well.
 

✨ AI Highlights

Bill Hoerr asks how to export GA4 custom definitions (ASC event parameters like flow, flow_outcome, comm_type) into BigQuery's native schema, which doesn't automatically capture them. Multiple respondents clarify that custom parameters don't appear in the default schema but are accessible by querying the `event_params` field directly using UNNEST functions, and some suggest bypassing custom definitions altogether by writing custom BigQuery queries to pull ASC data on-demand.

Replies Views 11 4,264 Started Last Reply