Hi,
I have an issue with the data in my Cart Update tag not being sent in the right order.
This is how an example of how our datalayer is set up ( Because we don’t have any product category to fill we data, we haven’t added that to the data layer though we have understood that it is optional data? ):
window.dataLayer.push({
event: 'cart_update',
products: [{
sku: '123456',
name: 'XXXXXXXX',
price: 1234,
quantity: 1,
},
{
sku: '23456',
name: 'XXXXXX',
price: 2345,
quantity: 1,
},
],
cart_amount: 3579,
});
And this is what our Cart Update Tag looks like( when it’s not able to send data ):
<script>
(function () {
var cart_amount = {{ cart_amount }};
var products = {{ products }};
products.forEach(function(product){
_paq.push(["addEcommerceItem", product.sku, product.name, product.category, product.price, product.quantity]);
});
_paq.push(["trackEcommerceCartUpdate", cart_amount]);
})();
</script>
But when we remove product.category
from the Cart Update Tag, it does send data that we can see in the Tracker Debugger, but it’s in the wrong order.
For some reason I can’t attach images to this topic so I will have to write it. It looks like this in the Tracker Debugger:
Item SKU: 1232354231
Item name: Example Product
Item category: 151,56 (This is the actual price of the product)
Item price: 1,00 € (This is the actual quantity)
Item quantity: 1 (This is getting added somehow that we don’t know)
Is there some way we can fill the Item category
field without having to add it to the datalayer? Like null, undefined, or something else?