We are using Snowplow in parallel to Google Analytics. So far so good except with the enhanced ecommerce tracking.
The problem occurs with the “add to basket” events on the product details page: it is added under the ecommerce object in the dataLayer without flushing the previous ecommerce events.
Consequently, the event “add” is labelled as “detail”:
In short, the ecommerce object contains 2 objects: “detail” and “add” but unlike Google Analytics which takes only the latest one, Snowplow records “detail” instead of “add”:
Looks like you’re pushing a product detail view and add to cart event in the one push. Here’s what Google recommends pushing:
// Measure adding a product to a shopping cart by using an 'add' actionFieldObject
// and a list of productFieldObjects.
dataLayer.push({
'event': 'addToCart',
'ecommerce': {
'currencyCode': 'EUR',
'add': { // 'add' actionFieldObject measures.
'products': [{ // adding a product to a shopping cart.
'name': 'Triblend Android T-Shirt',
'id': '12345',
'price': '15.25',
'brand': 'Google',
'category': 'Apparel',
'variant': 'Gray',
'quantity': 1
}]
}
}
});
Try pushing each event separately and see if that works.
Edit: Also if you’re pushing the dataLayer[n].ecommerce object as a data layer variable in GTM. Try setting it to version 1. That will ensure the variable is treated as a full object and ignore values pushed in previous events for detail, impression etc.