Implementation of Google e-commerce in my code
I already have implemented the dataLayer
variables and events in my code thanks to Google Tag Manager e-commerce implementation guide.
Thus, I do have in my code some portion of javascript like this:
<script>
/**
* Call this function when a user clicks on a product link. This function uses the event
* callback datalayer variable to handle navigation after the ecommerce data has been sent
* to Google Analytics.
* @param {Object} productObj An object representing a product.
*/
function(productObj) {
dataLayer.push({
'event': 'productClick',
'ecommerce': {
'click': {
'actionField': {'list': 'Search Results'}, // Optional list property.
'products': [{
'name': productObj.name, // Name or ID is required.
'id': productObj.id,
'price': productObj.price,
'brand': productObj.brand,
'category': productObj.cat,
'variant': productObj.variant,
'position': productObj.position
}]
}
},
'eventCallback': function() {
document.location = productObj.url
}
});
}
</script>
Implementation in Google Tag Manager
According to Google Analytics e-commerce guide, I should simply add a tag in Google Tag Manager this way:
In Tag Manager, create a Universal Analytics tag with these additional settings:
- Set the Track Type to either Page View or Event.
- In the Google Analytics Settings variable, under More Settings > Ecommerce, set Enable Enhanced Ecommerce Features to True.
- Select Use Data Layer.
Yet, the More Settings > Ecommerce does not exist...
So, how am I supposed to implement Google Enhanced Ecommerce using Google Tag Manager?