We are using enhanced eCommerce tracking by using data layer, to setup and test it in local environment. We can see page views in analytics but the event and impressions are not triggered. I tried using this:
dataLayer.push({
'ecommerce': { 'Impression': [ { 'name': '${product.name}' ,'id': '${product.code}' }]}
});
dataLayer.push({
'ecommerce':
{ 'detail':
{ 'products':
[{
'name': '${product.name}',
'id': '${product.code}',
'variant': '${product.style}'
}]
}
}
});
But I don't know how to test in local. I have tested using Google tag manager Debug mode, but it shows datalayer has been pushed but I can't track that event in Google Analytics