How to setup Ecommerce Conversion Tracking in Google Tag Manager | Part 3

In the final video of this E-Commerce tracking series, we’ll setup our tags in Google Tag Manager

We have gathered our important information and it’s ready to be used in our tools like Google Analytics, the Facebook Pixel and the Google Ads Conversion tracking code. But how can we get the data from the dataLayer to these tags? With Google Tag Manager! In this final video of our eCommerce tracking series, we will go through how we can setup all the triggers, variables and tags in GTM to properly transfer our data to these tools and ultimately track our conversions.

? Links:

GTM Container Download:

See all videos in this series:

? Measure Masters Membership:

? GTM Copy Paste

?Hire us:

? Recommended Measure Books:

? Gear we used to produce this video:


In this third video of our three part video series on ecommerce tracking with Google Analytics and Google Tag Manager, we are going to talk about how we can take that sweet information that we have now gathered in the last videos and transfer it onto our tools like Google Analytics, the Facebook Pixel and Google Ads. We just need to set up the right variables, triggers and tags to do this, and this is what we’re going to cover in this video. Now, we got lots to cover. Let’s dive in. In this lesson, we’re going to set up our tags in Google Tag Manager and forward the data on to our analytics tools. So let’s get started.

First of all, let’s look at this data layer. We have information available here. And on the left side, we see our events when the data is available. So on the page view right here, the data is not at the data layer. On the next event, this is a transaction event, which we have coded into the data layer, we have that information available. Now we are able to send on the ID and all the product names and so on to our tools, such as Google Analytics. So this is very important because we can base our trigger of that. So let’s head over to Google Tag Manager into our trigger section first, and create a custom trigger. So go to new here. And this will be a custom trigger for our transaction. And as the configuration we don’t want to fire this on page view, we want to fire it on the transaction event, which is part of this menu. But we can choose the Custom Event right here, where we put in transaction. We don’t need to fill out any filters here because this transaction event only happens once on the order receive page. So we can go with all custom events. And save this.

So now we have a distinctive point, when to send off the data. And we can proceed with creating our text. Now I have already a Google Analytics pageview tag installed and a variable, a Google Analytics settings variable that Google Analytics knows where to send the data to. So just to show you how I set this up. This is my Google Analytics settings terrible, I just pasted my tracking ID from my account in here. Now this page view will not send our enhanced ecommerce tracking data over. We will need to set up a tag that transports that data over. So let’s go over to new. And let’s give this a name. This is a Google Analytics event tag for our transaction data. And as a tag configuration will choose our Universal Analytics. And the track type, you might be tempted to choose transaction. But this is actually not the right track type to choose as this is connected to the classic ecommerce tracking, which you could still do. But nowadays, I would straight jump to enhance ecommerce tracking to implement. Now for enhanced ecommerce tracking, there’s no track type that sends over transaction data particularly. You would need to have other tags such as a pageview tag or an event tag to send that data with your event. So we go with event tag here as we can not make it inflate our pageviews. And as a category, we’ll just go with enhanced ecommerce. And as the action would simply choose our event here which pertains to the event key that we have right here. We can leave the label and value empty. Or if you want, you could add let’s add the page path to our label. The non interaction hit I would turn to true as it fires after the pageviews. And we’ll choose our Google settings variable. So Google Analytics knows where to send that data to. Now the last setting we need to set is to actually pull that data from the data layer and transfer with our event. So go to enable override settings in this tag and under more settings we’ll choose our ecommerce settings right here. And now we want to choose enable enhanced ecommerce features. Yes, we want to do this so true. And we want to utilize the data layer because we have the information available here already. Last but not least, let’s add our trigger which we have pre-configured and save this. Let’s refresh and go back to our page. Let’s reload that

and we see our Google Analytics event transaction has fired. We should also be able to see this in our tag assistant, we have one event here. And obviously also inside of Google Analytics under the real time reporting in events. And here we saw an event just happened. It will be under the events last 30 minutes as as it is a non interaction hit event. And here we go. We have our enhanced ecommerce transaction data. Here we go. Now what data gets sent over will later be seen inside of the conversions. Ecommerce reports here under sales performance. So we should be able to see this later on. This sometimes takes a while. So on the other end, let’s look up with our GTMGA debug extension enabled. Let’s go over to our developer tools. Here we have our GTMGA debugger. We would need to reload the page. And here we go. We have our enhanced ecommerce tracking. We click on our container. We see what data got sent over. And we also see the different products right here. So again, this is something you can check and see if is the right data that you have actually bought. But this is just pulled out of the data layer. If you don’t see anything in the enhanced ecommerce tracking tab right here, then this data might not have been correctly sent to Google Analytics, your tag might be not configured correctly.

But for us this looks good, we can actually now check already, if you have a smaller account, this happens faster. If you can see this already, in your ecommerce reports, I’m going to go here to today. And what was our ID 65. Here we go. This is transferred correctly. So now we have done the ultimate test actually to see if the data gets transferred correctly, it’s correctly displayed in Google Analytics. And we would be able to now utilize the data inside of Google Analytics. But what if you wanted to set up other conversion tracking based on the data layer the information that you have now in the data layer available? We can do this easily by pulling out the right data from the data layer. So for example, let’s set up a facebook pixel, you’re going to go ahead and go over to Facebook. And in our events manager, so we are here right now, we will look at our pixel, choose our pixel. And here we’re going to go on to set up install pixel. Going to go with the manual installation. And here, we’re going to get our Facebook Pixel code which we’re going to transfer over to Google Tag Manager. It’s via a Facebook event on transaction. And here we go with custom HTML, paste our code. And we don’t need the no script section as this is all JavaScript. And we initialize our pixel and then we want to track not page view but a purchase. Let’s go over to the next section here. And see under the manual event code installation what the syntax would be. Here’s a purchase, we want to set up this purchase with a conversion value. So in our case, it would be 70, for example. If you want we can enter a value for the currency. You see for example in here, we see the tracking code that we would need, going to copy this and paste this down here. We would need this Facebook track section. And we’re going to replace this from our pageview. And now we obviously again want to transfer the right correct value over that we get from the data layer. So we will need to set up a variable to pull that out of the data layer correctly. I’m just going to go to save here for now, and enter our variable section. And we want to create a variable that pulls data out of the data layer. And therefore we go to user defined variables here as new, give this a name data layer variable for our revenue.

And we’ll choose the data layer variable, we need to set up the right key here. So we’re going to go back to our order receipt page. Under transaction, we have our data layer available. And here see the revenue right here. This is what we want to pull out. How can we get to this? It’s a bit more complicated than just typing in revenue because we need to first get the ecommerce key within the ecommerce key the purchase object and then within the purchase object, the action field and then the revenue. So how would you go about this in the data layer variable? You would choose the dot notation. So we go with ecommerce.purchase.actionfield.revenue. Let’s save this and see if this works, refresh here, refresh there. And our new variables should now be available in this variable menu. So under transaction variable dlv revenue is now 70. So this is what we want to import into our facebook pixel. So I’ll go back to tags. In our Facebook section here. You’re gonna replace this with our variable which are two curly brackets. And this little menu opens and here we have our variables available, go with our DLV revenue variable, USD can stay as this and as a trigger, I choose again, all custom transaction trigger. So really easy already because we have set it up beforehand. It is now something we can reuse in our other tags.

So as you can see our transaction event, our Facebook event now fires and transfers this over to Facebook. So we have set up correctly our facebook pixel for conversion tracking. One more tag is left. This is our Google Ads tag. So I’m going to go over to the conversion section of my Google Ads account. If you don’t know where to find this, this is under measurement. And then here conversions. And here I have a purchase pixel. You can also set this up from new, but I have already set this up. And on here I have the tag setup. And we’re going to use Google Tag Manager and here is our conversion ID and our conversion label. So let’s go over to Google Tag Manager. I’ve just copied this. And we’re going to go with a new Google Ads conversion tracking on our purchase event. We’ll choose our Google Ads conversion tracking here, enter our conversion ID, enter our conversion label. And now we need to have the value of the actual conversion. And since there is a brick icon here, we can just click it and choose dlv revenue.

We also might want to enter the order ID just to avoid counting a duplicate because this will deduplicate all our orders if they are sent twice. So I can click on the spread icon here, we don’t have a variable set up right here. So I’m going to do this right from this menu. So let’s go with new variable dlv order ID. The variable will be a data layer variable. And here again, we need to find out what is the right key to choose ecommerce purchase action field and then ID. Let’s save that. And as a currency code, we can also hard code this, as you see, the trigger as always will be our custom transaction. And now we have that setup. for completion sake, I would say if you don’t have it set up yet, he would also need the conversion link attack for Google Ads. So don’t forget this, this must be simply deployed on all pages. Let’s set this up and refresh our page. Now let’s go back to our order receive page. And as we can see, we have now on the transaction event fire our Facebook Pixel, our Google Analytics event and ecommerce tracking, and then Google Ads conversion tracking. You could even set up more conversion tracking if you have any other quotes that you want to send that data to. Our tagging system tells us that we have our Google Ads conversion tracking installed as well with our conversion value and the currency. So this all seems to work just fine. I would always recommend to do a little bit more testing just so you know that this is all correct here, you might want to go through another test order better to check twice rather than have faulty data later on. But I’m pretty satisfied right now with our implementation. The last step in this whole process is always publishing a version. So it goes live to your users. You will do this by going into Google Tag Manager, clicking the submit button, giving your version and name and then publishing this to all your users. This video is brought to you by our premium membership MeasureMasters. If you truly want to master the art analytics and data, then become a member today and get access to over 70 hours of premium video content, exclusive tools and mingle with other fellow MeasureMasters in our community. And if you ever get stuck, I’m there for you to answer your questions and support you along the way to measure mastery. Join today and become a Measure Master.

All right, you made it till the end of our three part video series on Google Analytics ecommerce tracking with Google Tag Manager. Congratulations. Now I must let you know that this is just a tiny part of the enhanced ecommerce tracking feature set where there are so many more things that you could install more data layers and more tracking. So I’d encourage you to discover for yourself in the documentation of Google of how you can set this up. I hope this little video series set you up for the right steps already. And now I want to hear from you if you have set up ecommerce tracking successfully with this video series or you have any more questions, please leave me a comment down below. I love to hear from you. And if you haven’t yet, then maybe consider subscribing to our channel. Also don’t forget to give us a thumbs up and you will be rewarded with another video next week. My name is Julian, till next time

Leave a Comment