Enhanced eCommerce tracking demo shop: 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
I’m going to show you how you can track internal promotions like banners on your homepage with the help of Google Analytics Enhanced eCommerce tracking and Google Tag Manager. All and more coming up right after this.
Now, what are promotions in the sense of the enhanced eCommerce tracking? Promotions are, for example, banners on your homepage, where you actually want to bring the user deeper into the website or making them aware of a certain promotion that is going on right now. So for example, you could have a banner on the homepage saying we have 20% off on our shoes right now. So if the user clicks on this, then he goes to the category and he buys later the product may be. Now, you want to track how many people actually viewed this promotion, and then clicked on it and ultimately bought right. With the enhanced eCommerce tracking, promotion tracking, you can do all of this.
Welcome to the Enhanced eCommerce tracking demo shop. This is something you can access yourself at enhancedecommerce.appspot.com and this shop was built by Google to show off how you need to implement the enhanced eCommerce tracking to get full functionality of it. In order to see what needs to be implemented into the dataLayer, you can always click on this information icon here. And you see if the user clicks on this product, we need to deploy this kind of dataLayer. But today we want to concentrate on a particular dataLayer and this is the promo dataLayer. Right here we have a promotion going on. And when we click on it, we go to a product and then we can buy the product. Now, in the enhanced eCommerce tracking specification, you can in particular track when the user sees this promotion impression, and then also clicks on it. And the data layer that you need to implement for click is this dataLayer right here. And for the view, we actually have them on that page view when the page loads. Now we have product impressions here. But also down below here we have the promo view. So these are two dataLayers that would need to be sent over for the impression or promo data to work.
Once that data available and sent over to Google Analytics, what would it look like? If we go over to analytics, we can go under the conversions then under eCommerce and marketing then internal promotions. This is where the data would show up. If we have enhanced eCommerce tracking installed, you could see the name of the promotion then how many times it was seen, how many times it was clicked. And from there, it calculates the CTR. And if the user has bought a particular product, later on, we would be able to also see the transactions that are connected to this internal promotion click. So really interesting data. By the way, you can also use this for non-eCommerce tracking websites. It is just what Google Analytics calls and enhanced eCommerce tracking feature. And if you are flexible and can ignore the eCommerce label, you can also track, for example, internal promotions for a lead generation website or certain elements on the homepage that you want to classify as promotions.
Now you can put in a different creative if you have different creatives for flying ninja and a position. These, by the way, are pushed into dimensions that you can also access by the secondary dimension. So if you put in creative here we have internal promotion creative, this would be the creatives and we also have the position.
So I’m going to set this to true for now. Later, if you actually publish this, I would go back and set us to false because you don’t want to have that data always in your debug console. All right, and then we just need to choose a trigger, which trigger do we choose? We have an old pages trigger that would obviously mean that the ad would be triggered, or the promo view would be triggered on all the pages. We only want it to be seen on our particular page here. How can we target this page or every time the app is seen? This is actually pretty far down. So at the beginning, the user can actually see it. So I don’t want to send an impression over once the user lands actually on a page only if you scroll down and sees this ad. And this is something you can use the element visibility trigger for. So let’s go ahead and build one. I’ll go here to the plus and as a type, we choose element visibility. And now we can select a method to actually trigger this either an ID or CSS selector. Obviously, you would need to know a little bit of CSS and figure out what the right selector is. I’m going to go here and right click and go to inspect element. And this will give me the HTML markup. And luckily, for us, we have here our section, our section of the ad. And it has an ID, media image two. So I’m just going to double-click on that and copy it and fill that into the ID. In most cases, you will probably need to use a CSS selector, which gets more complicated as you try to filter down on the elements that actually should be viewed here. So I’m going to go with the ID though. And I can choose whether they should fire every time the element is seen. This would be this one once per element. So if you have multiple elements only once it will fire or once per page. I will choose once per page for our example here. And how much should be seen of that element? 50% is fine with me. Now, I don’t need to worry really choose any filters here as this will only fire if the media image two is actually seen. Now, let’s just give this a name. This is the visibility trigger for our ad. Let’s save and save this again here. And now let’s try to this all out, refresh our page.
Well, it’s already fired here because it just down there. Let’s reload again. Somehow remembers where I was at a time. Now let’s go to another category here.
Let’s go to the t-shirts and see if this works. Okay, now we are on the t-shirts page and we just gonna scroll down. And we see element visibility now fired. And our ee promo view has fired as well. Now, this information is sent over to Google Analytics. How can we make sure that it was actually sent? That’s where this debug view came in that we have activated in our tag. We can open up the developer tools again, right-click Inspect Element and here under the console, we should now have information available of what data was actually sent over to Google Analytics. First of all, we had our pageview. This is something that fires normally on the page as we have a pageview trigger installed. And then afterward, we should see an event and this event should have our enhanced eCommerce tracking data in here as well. So here’s our event. And we also sent over an EC add promo. And this is our ID, our name and so on. So this was sent over to Google Analytics correctly. We can look this up in the account on the real-time reports here on the events. You see events last 30 minutes, we have our enhanced eCommerce tracking promo view that was sent over. Now, this only tells us that the event was received by Google Analytics. But did it actually pick up the right information from our enhanced eCommerce tracking dataLayer or the eCommerce object that we send over? Let’s go over to our conversions and under eCommerce, marketing internal promotions, we need to set the right date. Just going to pick the last date and here we see some information already been received. So we have here our internal promotion and our promotion views and the clicks or something that test it out beforehand, which we’re going to get to in a second. All right, so this is how you can already send over information about the promo view. In the next video, we’re gonna take a look at how we can send over our click data to Google Analytics as well.
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.
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.