Item dimensions, parameters & metrics (GA4)
How to query the most important items (product) dimensions and metrics from the GA4 BigQuery export, like item id, item name, item brand, item category, custom item parameters, price, quantity and item revenue.
A lot of Google Analytics 4 dimensions and metrics can be derived straight from the tables without performing calculations on the data. With the help of unnest
and parse
for dates or timestamps we can do the trick.
Other dimensions and metrics that you might need are a bit harder to access. You will have to (re)calculate them, which can require some serious SQL-skills.
While designing the course Query GA4 Data In Google BigQuery I've learned a lot about best practices to calculate dimensions and metrics. To share this knowledge with you I will provide a combined query for default dimensions and metrics, and a single example query for every non-default dimension or metric.
As always, drop a line in the comments if you have any questions, feedback or suggestions related to this article.
Default items dimensions
- items.item_id
- items.item_name
- items.item_brand
- items.item_variant
- items.item_category
- items.item_category2
- items.item_category3
- items.item_category4
- items.item_category5
- items.coupon
- items.affiliation
- items.location_id
- items.item_list_id
- items.item_list_name
- items.item_list_index
- items.promotion_id
- items.promotion_name
- items.creative_name
- items.creative_slot
Item parameters
Available from 2023-10-25
:
- items.item_params.key
- items.item_params.value.string_value
- items.item_params.value.int_value
- items.item_params.value.float_value
- items.item_params.value.double_value
Default items metrics
- items.price_in_usd
- items.price
- items.quantity
- items.item_revenue_in_usd
- items.item_revenue
- items.item_refund_in_usd
-- comments
in the example query below for names and definitions and copy the part you need from the select
clause. Make sure that you also add any additional conditions (i.e. with
, from
, where
, group by
, having
and order by
) that are necessary to calculate the results correctly. E.g, the query below is ungrouped, so every row corresponds to an event and may contain duplicate rows.