1

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...

enter image description here

So, how am I supposed to implement Google Enhanced Ecommerce using Google Tag Manager?

1 Answer 1

2

Standard Ecommerce requires the Track Type - Transaction tag, Enhanced Ecommerce requires a Track type of Pageview or Event.

To access the More Settings option, click the checkbox for Enable overriding settings in this tag directly below the option Google Analytics Settings. It will then reveal the other settings you are after enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.