• Stop being a LURKER - join our dealer community and get involved. Sign up and start a conversation.

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.