Reputation: 355
I'm implementing enhanced ecommerce in Google Analytics and I have a problem. When the purchase of a product is made, it's redirected to a thanks page and that's where the Purchase event is sent to Analytics.
ga('require', 'ec');
ga('set', 'currencyCode', 'EUR');
ga('ec:addProduct', {
'id': 'prueba-001',
'name': 'Prueba',
'brand': 'Prueba',
'category': 'Prueba',
'variant': 'Prueba',
'price': 10.50
});
ga('ec:setAction', 'purchase', {
'id': 't-prueba-01',
'revenue': 5.50
});
ga('send', 'pageview');
The 'purchase' event is recorded perfectly, but the addProduct event is not quite right, the unique purchases of each product are registered but nothing else.
I don't know what else to do, I have followed the steps in the documentation and the problem persists.
Edit:
Upvotes: 1
Views: 88
Reputation: 14189
Try to use quote for price and revenue (for consistency with the documentation) and above all add the quantity parameter to the product.
Upvotes: 1