Extract Product Context from Conversions Data

Updated by Omar Elmaghrabi

This page describes how you can extract product context from the Conversions datasets in Rockerbox warehousing.

Product information is recorded in the Conversions schema in the additional_attributes column, which is stored in JSON format. You will need to use a specific function in your SELECT statement to extract the products field from this column. The SQL syntax will vary based on your warehouse.

Snowflake

additional_attributes:products::varchar

See Snowflake documentation for more context.

Redshift

json_extract_path_text(additional_attributes, 'products')::varchar

See Redshift documentation for more context.

BigQuery

JSON_EXTRACT_SCALAR(json_column, '$.products')

See BigQuery JSON functions documentation for more context.

Example Query - Snowflake

select 
*,
additional_attributes:products::varchar
from conversions_table --replace with your table name

Product information can be stored in different formats in the additional_attributes column depending on how it is passed to Rockerbox. You might need to further process the products field if you would like to report on individual products and there are mutliple products associated with a single order. This would entail breaking out the products across rows and allocating revenue from the order to individual products - this is not natively supported in Rockerbox and would require custom SQL.


How did we do?