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

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

January 14, 2020


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

19 Comments

  • Reply Alexandre Cerqueira September 17, 2019 at 5:33 pm

    Excelent Playlist

  • Reply Aqib Usman September 18, 2019 at 2:55 pm

    hello sir how i can become your channel member?

  • Reply Rob CLtv September 22, 2019 at 5:46 pm

    YouTube will suggest trash content all day, but quality content like yours I have to search for directly. Crazy. Thanks for the valuable content man, much appreciated

  • Reply Leon Profes September 24, 2019 at 5:13 am

    I wanted to tell you something.

    Your videos are top notch, down to earth and exactly what is needed. I watched your videos and they helped me learn advanced things that other "Ad Agencies" would charge me ton of money!!

    With your videos i was able to learn easily and to make my small company website move and make goals.

    IMHO it is precisely what internet was made for. To get information, to learn and to move on. Not to hide knowledge and to keep things away. You and your work are bright examples of these days sad internet people.

    I wish you earn decent money from sharing your knowledge and to prosper. Thank you for all your work and thank you for your channel.

    Keep up the good work.

  • Reply Badr Moufid September 30, 2019 at 2:15 am

    Thanks alot mate. Quick question tho, if the GA – Event – Transaction doesn't fire,
    what can cause it not to fire and how to solve it ?

  • Reply Amith singh October 2, 2019 at 9:31 am

    Hi Julian, absolutely love your channel. I have a GTM question that's doing my head in from the longest time and it would help me so much if you could answer it.

    Q: Is there functionality in GTM where I can see all the tracking parameters present on my website according to URL. basically I want to know what tags are triggers are firing on every page of my website in one document so I can audit it and make changes? If no, how else do you reckon I perform such a task?

    Thank You
    Amith

  • Reply Heinz Duschanek October 3, 2019 at 6:38 am

    Hello Julian,

    great video, again.

    My question: how do you handle now the new requirements due to the GDPR/DSGVO (Opt-In for tracking cookies)? Skip the plugin of DuracellTomi in order to be able to use something like Borlabs Cookie, thus creating all dataLayers manually now (as Borlabs Cookie does not seem to implement dataLayer-objects)?

  • Reply Invictus Concept October 4, 2019 at 10:44 pm

    Great video, thank you for support.
    Is it better or even necessary to define the price and quantity of each purchased product in facebook conversion pixel code?

  • Reply Sogishirts Official October 12, 2019 at 4:13 am

    I hope I can get more tips to increase my traffic.

  • Reply S Serafin October 23, 2019 at 7:56 pm

    Hey Julian,

    Thanks for getting this done so quickly. I really appreciate you doing so after we spoke a few months back. Odd that I didn't get notified. Urrrgg.

    One thing that I wanted to check with you is when adding the script with PHP I assume we're not using GTM anymore. We have to embed that into our thankyou.php file in order to make the dynamic variables relay to GA. Correct?

    I also noticed that your PHP looked very similar to mine but when writing if statements both yours and mine broke the site/page. So I'm wondering if something changed recently and if you're aware of it.

    I've listed my PHP code on Github so you can view. Thanks
    https://gist.github.com/StefsterNYC/f4441fb3ff86b4baaab76faf0d434950

  • Reply bamidele moses oladotun October 23, 2019 at 8:54 pm

    Love the video. You did a great work.
    Now my question is what is the difference between conversion set on Google analytic and that set of Google tag manager. Are they different or not?
    Thanks for the anticipated answer sir

  • Reply Trần Sakura November 15, 2019 at 1:32 am

    Great video, thank you for support.

  • Reply Parbesh Maurya November 18, 2019 at 9:44 am

    Hi, my ecomerce data not coming in analytics and I am triggering ecom data layer on page load only. Is I will also create event to solve that.. Thx in advance

  • Reply Attilio Urciuolo November 22, 2019 at 10:11 pm

    The best guide in internet….top!!!

  • Reply MeasureSchool December 5, 2019 at 6:57 am

    Part 1: https://www.youtube.com/watch?v=xgLGWvhOyHU
    Part 2: https://www.youtube.com/watch?v=3G5wvjC1rHo

  • Reply Frank Pereira December 14, 2019 at 7:44 pm

    So I followed the steps but was not able to see the transaction I wish they was a video to see if nothing shows. I would rather hire you to set up seeing you can jump in and get it done quicker.

  • Reply Alexandru Popescu December 25, 2019 at 6:52 pm

    Thank you, I can finally see my ecommerce data in G Analytics. But why there is still "No recent conversion" in Google adwords?

  • Reply Ornilo Santiago January 10, 2020 at 12:03 am

    Hi Julian,
    What happens if a user waits for more than 30 min and refresh the confirmation page? Do I have duplication data in Analytics?

  • Reply Michael Mehrle January 12, 2020 at 4:53 pm

    Super Video – vielen Dank!

  • Leave a Reply