Auto-Event Tracking with Google Tag Manager | Lesson 5 – GTM for Beginners

In this video, I’m gonna show you how you
can track interactions with the help of Google Tag Manager, transfer them to Google Analytics
as events, and make them useful to improve your website. All that and more coming up right after this. Hi there and welcome to another video of,
where we teach you the data-driven way of digital marketing. Now, in the last lesson of our Google Tag
Manager for Beginners series, we installed our first tag, and showed you how you can
migrate tags over to Google Tag Manager safely and securely. In this lesson, we’re gonna talk about my
favorite feature of Google Tag Manager, and, frankly, what Google Tag Manager is best known
for, and this is the interaction tracking via Auto-Event triggers. Before we get started, as always, we have
a little bit of a challenge for you prepared at, where you can
test your knowledge and see whether you understood everything we taught you in this video. But now, we’ve got lots to cover. Let’s get started. Back at our demo shop, before we start talking
about how we can pick up interactions with the help of Google Tag Manager, we actually
need to talk about triggers. What are triggers? Well, if you go over to Google Tag Manager,
we have already our first tag deployed, with the All Pages trigger attached. What are triggers exactly? Well, really they are just rules that determine
when our tag should be deployed. So in the case of the All Pages trigger, it
will deploy our tag on all the pages that Google Tag Manager is installed on. Now, what if you only wanted to deploy our
tag on one page? Then we would need to configure a new trigger. Let’s go into a little example here. Let’s go into our Google Analytics tag, and
actually edit our triggers. We’ll get rid of our All Pages trigger and
add a new trigger to the tag. We can do this by going into our trigger menu,
which will show us all our triggers. Right now, we only have our All Pages trigger,
which is built in. You can click on this plus button to create
a new trigger. And let’s say we wanted to deploy this tag
only on the contact page. Now we need to configure this tag by clicking
in this menu again. And we have different options here. We already see some of these interactions
that we will get to in a minute. But really, what the All Pages trigger did
is fire our tag upon page use, or when we enter the site. And there’s an event for this, called the
Page View event, so we can click on this. And now we can filter down, and instead of
choosing All Page Views, we can go with Some Page Views here. And this filter menu opens, and you have different
options here. Right now we could choose, for example, the
page URL, and it should contain our contact address. Let’s save this. Save our tag, and enter the Preview and Debug
mode. Let’s go back to our demo shop, reload our
demo shop. We see our Preview and Debug mode, and let’s
go to the contact page. And we get a little bit of an error, which
is a little bit misleading. A small bug here, because actually, if you
go to Page View, we see that our Google Analytics Page View tag was deployed correctly. And if you go to any other page, for example,
this landing page, we see that the Page View was not loaded. Let’s go back to our contact page and see
how we can actually inspect triggers within the Preview and Debug mode. We simply need to find the tag that was deployed
here under our Page View event. And we can click on it and scroll down, and
we see our firing triggers. We see that it fired upon our contact trigger
turning true, which means that the event equaled gtm.js, something that you don’t have to understand
for right now, but our page URL contained contact, which is true because we see the
contact up right here. So that is how you can use triggers to fire
tags on only specific pages. I will go back here and change this around,
because we want to actually fire our Page View tag on all pages within our site, otherwise
our general page view tracking would not work anymore. But as you could see, we have now a additional
contact trigger configured that we could also reuse in other tags. But now, let’s take a step back and look at
a little bit of theory about triggers and how they actually function, so we can utilize
our knowledge for configuring an interaction-based trigger afterwards. Once you deploy a trigger through Google Tag
Manager, it will be the instance that decides whether a tag should be deployed and be able
to transfer data over to the marketing vendor, in our case, Google Analytics. In the case of these special Auto-Event triggers,
like click trails or from trails, there are two more functionalities that these triggers
carry. One is the listener, and the second one is
the filter that decides whether a tag should fire or not. How does that look like? Another example. Well, let’s say you have Google Tag Manager
installed on a website, and an Auto-Event trigger installed. This trigger will listen for every interaction
on that page based on the event that you chose, and send the data over to Google Tag Manager,
and then, depending on your filter settings within your trigger, this will lead to a tag
deployment or a prevention of that tag deployment when an interaction is registered. Now, let’s take a look at how this would play
out in practice. All right, back at our demo shop. We now want to get into interaction tracking. And I’ve chosen this product page here of
our demo shop, where we want to track the Add to Cart click. Now, the first step is a little bit of a configuration
that you have to do one time. You need to go over to Google Tag Manager
and make sure in your variables menu that you have your click variables activated. If that is not the case, you can go to the
Configure button here and scroll down to your click variables. Make sure that they are all enabled. Once you have done that, you don’t have to
do it again, and we can proceed with the setup of our interaction tracking, the first step
being building a generic click trigger. Now, the purpose of this generic click trigger
is actually the listener part. You want to know if the listener part works
correctly. So we go on a new trigger here, and title
this trigger. And go into the configurations, and we’ll
choose All Elements, ’cause our button is not a link, so we’ll go with All Elements
here. And for now, we’ll keep the All Clicks fire
on option ticked in order to pick up all the clicks that are happening on the website. Let’s save this and go into our Preview and
Debug mode. Let’s go back to our demo shop, reload our
demo shop. And we can see whether our listener works. If we click anywhere on the website, we see
that down here, a new event was initiated. Now what we want to do is actually click on
different elements here, and I will do this with the command key pressed, so if, for example,
we’re gonna click on this home button, it opens up a new tab. This will prevent my browser from reloading,
and we will be able to inspect these events a little bit closer. And, of course, I will also click on our Add
to Cart click here, which was our click number seven. And what we can do now is actually look a
little bit closer into this and inspect these events. So if I click on this sixth click here and
look into the variables, we’ll be able to see our click variables that we have just
enabled. Now, these click variables will be automatically
filled by Google Tag Manager depending on what you’re clicking on. So what we want to find out is, which of these
variables can we use for our filter in order to only fire when somebody clicks on this
Add to Cart click. Now, we clicked here on the home menu, so
our click text actually got filled with home. If you go to the next event here, we see we
clicked on the Add to Cart button, and the click text was filled with Add to Cart. So we can use the click text to filter down
and only make our trigger turn true when somebody clicks on the Add to Cart button. How would we do that in Google Tag Manager? Well, we would turn our generic click trigger
into a specific one. So let’s go back into the click trigger and
rename our trigger. My naming convention is usually the trigger
type, and then a little bit of a description. That should do it. And now we can configure our trigger again. We’ll leave the trigger type as is. We’ll just change the fire on option here,
go to Some Clicks, and choose our variable that we want to filter down on, which is a
click text, which should contain Add to Cart. That should do it. Let’s save this. Now, unfortunately we won’t be able to see
anything in the Preview and Debug mode if you test that out right now, because we need
to test triggers in conjunction with tags. So let’s attach our trigger to a new tag. Let’s go over to our tags here and build a
new tag. And what I wanna build is actually a Google
Analytics event tag which fires on an Add to Cart click. Now we can configure our tag. Click here again on Universal Analytics and
enter our Tracking ID. And instead of the track type being Page View,
it makes sense to send interaction data to Google Analytics via the event type. So we go with event tracking here. And there are a few more things to fill out. The category, and the action. This is specific to Google Analytics. If you would use a different web analytics
tool, then there might be other configurations that you would need to take care of. This should do it. Now all we need to do is attach a trigger. And we can choose our click, the Add to Cart
click trigger. Let’s save this, and refresh our Preview and
Debug mode. Go back to our product page here in our demo
shop. Let’s reload that. And let’s first do the negative test. I’m gonna click on this home button. Let’s see if anything fires. Nothing fired on this event. And now let’s click on the Add to Cart button. Let’s see if anything fired. Yes, as expected, our Google Analytics event
tag fired. Now we will be able to see that also in our
extension of the Google Tag Assistant. In Google Analytics, we see here, one event
fired. So that should work. If you go back to Google Analytics directly,
into our reporting, and go into the real-time reporting, we should also be able to see that. And here’s our event that was just sent over. So this works as expected, and we have successfully
built in our first interaction tracking event with the help of Google Tag Manager. In the end, we’ll be able to publish this
as a version to all our users. So now you know how to track events with the
help of Google Tag Manager and Google Analytics. Now, there are many other interactions that
you might want to track with the help of Google Tag Manager, and we have some other videos
on that which I will link up below. But after this video, if you wanna take action
on the knowledge that you have actually acquired here, then head over to,
where we have a little bit of a challenge for you prepared that you can go through in
order to solidify your learning. So check that out at And if you liked this video, then join me
at the next lesson, where we’re really gonna talk about the most important interaction
that you should be tracking, which are your conversions. I’m Julian. Till next time.


Add a Comment

Your email address will not be published. Required fields are marked *