Reputation: 6919
When firing the add_to_cart
or remove_from_cart
events in Google analytics, what should the quantity
value represent? Should it be the value you are adding/removing or the updated quantity of that product in the customer's cart?
For example, with the following code, does Google now think there are 4 of the item in the cart or 2?
gtag('event', 'add_to_cart', {
"items": [
{
"id": "P12345",
"name": "Android Warhol T-Shirt",
"quantity": 2,
"price": '2.0'
}
]
});
gtag('event', 'add_to_cart', {
"items": [
{
"id": "P12345",
"name": "Android Warhol T-Shirt",
"quantity": 2,
"price": '2.0'
}
]
});
Different analytics tools seem to handle this differently and the GA docs don't make it clear to me what the value should be.
Thanks in advance for any help!
Upvotes: 5
Views: 772
Reputation: 5545
Based on my personal experience (trial and error) I was able to figure it is the number of items you are adding/removing from the cart. Not the number of items you have in your cart after adding/removing items.
And I agree, the documentation should be more explicit about this.
Upvotes: 5