Google Analytics Enhanced Ecommerce Tracking can be installed with Google Tag Manager. In our last part (link below) we discovered how to track the view of a Promotion with the Element Visibility Trigger. In this part, we are going to track the click of the Promotion.
Enhanced eCommerce tracking demo shop: https://enhancedecommerce.appspot.com
DataLayer Documentation: https://developers.google.com/tag-manager/enhanced-ecommerce#promo
Container Download: https://measureschool.com/wp-content/uploads/2018/12/EECPromo.json
🎓 Learn more from Measureschool: https://measureschool.com/products
🚀Looking to kick-start your data journey? Hire us: https://measureschool.com/services/
📚 Recommended Measure Books: https://kit.com/Measureschool/recommended-measure-books
📷 Gear we used to produce this video: https://kit.com/Measureschool/measureschool-youtube-gear
So here we have our dataLayer. As I said, we are not really pushing anything into the data, we just need the eCommerce object. So we can get rid of anything right here, dataLayer push and back here. Now, this is built, especially for a tracking scenario where you would forward the user on and you want to ensure that the data is actually transferred. This is done within the event callback, we can get rid of this portion as it is deployed through a variable here. So I’m going to get rid of these data points as well. And this should give us our enhanced eCommerce tracking object except for the event up here. This one is also something we wouldn’t need as we are not deploying a dataLayer. We want to simply have our eCommerce data object. Now, you see this promo object ID, project object name, and so on. This actually needs to refer to the same data that it was actually viewed. So we need to have the same data in here as we had from the one that is viewed. So I’m going to just save this, for now, go over to our view here and copy out our promotions view here. All right, let’s go over to the click data and type that in as we had before. So now we are clicking on the same data as via viewing. And if you know about enhanced eCommerce tracking, you know that you need to keep data consistent. Otherwise, the data reports inside of analytics won’t be filled correctly. So we have this now prepared. And again, we need to go through and build a tag for this. In our case, this can also be copied. So let’s copy our event here. This time, it will be a promo click event. Also going to change the event tracking parameters, this will be a promo click. And we obviously want it to pick up different data, not the view data, but the click data. So this is now specified as well. And we want to change our trigger out. So let’s click here and get rid of our visibility trigger. And in our case, it would be simply a click trigger. So let’s go here for our clicks. And I’m going to go with the all elements trigger. And let’s keep it generic for now, I’m going to build a generic click trigger.
Press this button and we see our click has fired. If I click anywhere else, it also generated GTM click but nothing fires. So this works fine. And we have now deployed our data. Let’s see if it is received by Google Analytics. Let’s go back to the real-time reporting on the events we see that there are some new events here. We had our promo click, three times promo click and that data should then also have attached our enhanced eCommerce tracking data. We can actually check inside of our let’s go on to inspect here this will open up our developer tools and we have under the console. Let’s reload our page actually. Here is our Google Analytics information. The page view has fired now also our page promo view should have fired and now click with the command keypress. Yes, we get our data in here as well the creative and so on. Everything that we have filled in. This time it’s a promo click so that data was transferred over to Google Analytics. We already saw this here in the enhance eCommerce click was just registered. Now let’s look into our conversions under eCommerce reports, marketing, and internal promotions and go to the right date.
And we see our internal promo clicks were also registered here. So this data was transferred correctly.
All right, so there you have it. This was it with our little tutorial here on promotion tracking with enhanced eCommerce tracking features. Now, it’s always astounding to me that you can utilize all the built-in mechanisms of Google Tag Manager such as the element visibility trigger and then also the click trigger to make this deployment happen. I’d love to hear from you if you run into any problems or if you want to use this tracking deployment. If this helps you please leave us a comment down below. I always love to hear from you guys. And if you liked this video, then give us a thumbs up and also subscribe to this channel if you haven’t yet because we bring you new videos just like this one every week. Now, my name is Julian, til next time.