GTM Tip: Prevent Duplicate Enhanced eComm Event Hits
Learn this quick Google Analytics variable tip to prevent duplicate enhanced ecommerce events.
You’re a marketing guru and have implemented onsite behavior tags (or had someone do it for you!) to help unlock even more insights from your customer behavior.
Plus you have enhanced ecommerce enabled on your store for rich merchandising data.
I’m going to share a tip to prevent dirty data that I learned the hard way (I make a lot mistakes when testing new things!).
It was also one of our QA scenarios for our enhanced ecommerce implementation with our new GTM app for Shopify that we accounted for.
- You have GTM implemented with the data layer fleshed out with enhanced eCommerce data.
- You have a scroll tracking custom event implemented (or some other type of custom event tag for Google Analytics)
You most likely have a Google Analytics variable setup in GTM > Variables > User-Defined Variables that you use to assign to event tags.
And it’s likely you might have it setup something like this where you have the data layer selected for enhanced ecommerce:
But here’s the thing:
When you you assign this variable to a scroll depth event tag (or any other custom behavior event), and you leave the Google Analytics settings “as is” then you’re likely pushing additional enhanced ecommerce hits when these tags fire without realizing it.
If you’re using the Google Chrome GA Debugger extension then you can recreate this issue yourself.
Go to a page on your site and open up your Google Chrome console and look for your scroll (or other) event:
If you see this, then do you see this event fire next within the chome debugger (if you’re on a product page):
What’s happening here is since this event is set to fire AND use the data layer, the event is looking to the current data layer values and firing this additional event data along with the scroll.
How to prevent this duplicate enhanced ecommerce hit?
There are a few ways to do this but the route that I usually take is to ensure all of my custom event tags have the enhanced ecommerce setting set to “false” like this:
This means even when the data layer exists on the page during my custom events that the data won’t be used within an event hit.
That’s it – I hope that helps you prevent your own dirty data 🙂
Questions? Feel free to drop them in the comments below!
Get Exclusive Elevar Insights directly to your inbox.
Get free analytics tips and resources delivered directly to your inbox.
Shopify Tagging Experts
Learn how Elevar helps brands scale with expert tagging and event tracking across all marketing channelsLearn More