Ad

GA / GTM Enhanced Ecommerce | Measuring Product & Product Details Impressions

I have been trying to correctly implement Google Analytics' Enhanced Ecommerce in our Shopify Store and Checkout as well as our own custom recurring checkout. And for the most part I got it working really well.

But I can't figure out how to implement Measuring Product Clicks and Measuring Views of Product Details 100% correctly as the Tag Configuration for those measurements has to be tracked as a Pageview with the trigger set to event equals gtm.dom and that causes the error "Same web property ID is tracked twice." in the Google Tag Aassistant.

I'll gladly pay for help with this if anyone would be so kind to take a look at this.

Currently on page load of our Shop 3 Tags fire.

  • GA Pageview
  • Pageview Product Impressions
  • Pageview Product Details Views

Which presumanly causes the aforementioned error in GTA. ("Same web property ID is tracked twice.")

How do I correctly implement Measuring Product Clicks and Measuring Views of Product Details in this case?

I alredy tried loading the regular GA Pageview on DOM Ready and set an execption for the Firing Triggers so that GA Pageview is not fired if Pageview Product Impressions or Pageview Product Details Views is fired.

But that still leaves me with 2 fired tags, which still causes the error. And also I am not positive that this is the correct way of doing it.

Please let me know if I can further explain something or improve this question somehow. Again, I am new here and I am happy to pay for help.

Been at this for 2 days 😅.

Thank you in advance for all your help and inputs! I appreciate it!

All the best, Markus

Ad

Answer

You have two options when it comes to measuring product detail impressions:

  1. Send the product detail impression data along with the existing page view tag that fires on this page.
  2. Send the product detail impression data in a separate GA event tag after the page has loaded.

Which option you choose depends on whether you're able to push the product detail impression data onto the GTM dataLayer before the GTM container code or not. If you can push the product detail impression data onto the dataLayer, then you would use method (1) above. If, for whatever reason, you're not able to push the product detail impression data onto the dataLayer before the GTM container code, then you would use method (2) above.

For method (1), your code would look as follows:

dataLayer.push({
  'ecommerce': {
    'detail': {
      'actionField': {'list': 'Apparel Gallery'},    // 'detail' actions have an optional list property.
      'products': [{
        'name': 'Triblend Android T-Shirt',         // Name or ID is required.
        'id': '12345',
        'price': '15.25',
        'brand': 'Google',
        'category': 'Apparel',
        'variant': 'Gray'
       }]
     }
   }
});
//Your GTM container container code goes here

You when then simply setup a regular GA page view tag with trigger "All Pages" and make sure that the ecommerce option is checked in the tag configuration: Enabling enhanced ecommerce in GTM tag configuration

Method (1) is the recommended method but if this isn't possible for you, then method (2) would be as follows:

dataLayer.push({
      'event' : 'productDetailImpression',
      'ecommerce': {
        'detail': {
          'actionField': {'list': 'Apparel Gallery'},    // 'detail' actions have an optional list property.
          'products': [{
            'name': 'Triblend Android T-Shirt',         // Name or ID is required.
            'id': '12345',
            'price': '15.25',
            'brand': 'Google',
            'category': 'Apparel',
            'variant': 'Gray'
           }]
         }
       }
    });

As you can see, the difference here is that we have now added a custom event named productDetailImpression to the dataLayer push. The sole purpose of this custom event is to allow us to trigger a separate GA event tag in GTM whose sole responsibility is to pick up this enhanced ecommerce data and send it to GA. We achieve this as follows in GTM:enter image description here Notice the following things:

  1. The track type of the tag is Event (not Page View)
  2. The category and action of the event don't really matter. We're simply using this event to send enhanced ecommerce data to GA.
  3. The ecommerce setting is enabled for this tag.
  4. The tag has a custom event trigger defined as follows:enter image description here
Ad
source: stackoverflow.com
Ad