Search code examples
google-analyticsgoogle-analytics-4

GA4 add_to_cart items parameter


The GA4 ref docs are not very clear what the items parameter is for the add_to_cart event.

Is it the cart after the product has been added (I mean, this parameter is a list) or is it just an array with one item - the product that was just added?

https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtm#add_to_cart


Solution

  • items must be an array with one OR multiple items depending on how the shop system/user journey works (most of the time it would contain a single product that got added to the cart). The crucial part would be to have either the item_id or item_name keys along with the quantity key that represents your product(s). If no quantity is defined, then GA4 would consider quantity = 1.