google tag manager basics

Google Tag Manager Basics: Master Tags and Triggers

Learning Google Tag Manager basics begins with mastering tags and triggers. So let’s master the theory of how tags and triggers work and then walk through the process of setting them up in GTM.

Once we set up our trigger and tag in GTM, we’ll send event data into Google Analytics based on the specific event parameters we specify.

What is a Tag in Google Tag Manager?

A tag is piece of code that can send data to a system such as Google Analytics. A tag could be something like the code for a Facebook tracking pixel, or the code snippet for Google Analytics. The screenshot below shows the two Google Analytics tags on the Root and Branch site (the GA4 property type and the UA property type) within the associated Google Tag Manager account. In addition to tags like this, we can create other tags to track a specific action on our website. You can see these other other types of tags in the first five tags below.

ga4 and ua tags in gtm

These actions are called “events”, which is why you’ve probably heard the phrase “event tracking” in terms of Google Tag Manager and Google Analytics. We’re going to walk through an example of creating a tag and associated trigger for event tracking in the walkthrough below.

a blue tag

Explain These “Events” A Bit More

An “event” could be something like scroll depth tracking, or video plays, or page timer tracking, or link click tracking. [Note: the prior links all show video walkthroughs of setting up each of these types of events with Google Tag Manager and Google Analytics.] In this case, the event we’re going to be tracking is a specific click from a specific page (the Root and Branch homepage) to a specific destination (the Root and Branch YouTube channel).

What is a Trigger in Google Tag Manager?

A trigger “listens” for certain actions (the aforementioned “events”) to take place. Those actions could be clicks, form submissions, pageviews, scroll activity, or video plays. For a tag like a Facebook tracking pixel, the trigger will be a pageview of any page of the website in question. That page loading (the trigger) will tell the Facebook pixel (the tag) to get to business and start collecting data. For a more specific action that we want to track like our example of tracking clicks from the homepage of this site to the YouTube channel, we’ll want to create more specific rules for our trigger.

a trigger for a gtm event

On its own, a trigger can only listen. It needs help in order for data to be created and shared with an associated platform like Google Analytics.

How Do Tags and Triggers Work Together?

Within the Google Tag Manager platform, we will define our trigger and our tag. The trigger is specific action that we are listening for. The tag holds the data that we want created. When a tag is paired with a corresponding trigger, data will be sent through to Google Analytics as the trigger fires.

It looks like the diagram below.

trigger and tags in google tag manager

If you want to skip the reading and jump to the video, check out the linked tutorial below. This has all the info you will need. Otherwise, read on below for more info.

Google Tag Manager Basics Video Guide: Setting Up a Tag and Trigger in 12 Minutes

The linked video explains the theoretical background of these Google Tag Manager basics. It also reviews a complete walkthrough of creating the tag and the trigger.

If you’d prefer the text version, please read on below.

Before We Begin: Here’s What We’ll Need

We’ll be working with Google Tag Manager and linked Google Analytics (UA) property. And we’ll need to create a User Defined variable in Tag Manager for our Google Analytics property. Let’s see how that’s done.

Google Analytics

We’ll need to be working with Universal Analytics (UA) property type for this project. The parameters that we specify in creating our GTM tag will be the same event parameters that flow into our Google Analytics reporting. So we need Google Analytics to see the results of our tag and trigger work in Tag Manager.

The new GA4 property is similar in that we can use GTM to configure specific events, but the rules for naming events are very different (and a bit more complicated). For that reason, among others, UA still makes a lot of sense. If you’re considering whether to use Google Analytics 4 or Universal Analytics for your site, the recommendation here is to use both.

google analytics png

Google Tag Manager

GTM is where we’ll actually be doing the work to create our trigger and our tag. If you are not currently using Google Tag Manager, you can check out this guide to set up Tag Manager on your WordPress site.

google tag manager png

Within your GTM container, you’ll also need to have created a User Defined Variable for your Google Analytics property. If you haven’t done that yet, there’s good news: it only takes about 30 seconds. Hit the “Variables” menu in the left-hand navigation in GTM and then scroll down to “User Defined Variables”. Then, hit the blue “New” button to create a new variable.

Now, scroll down to select the “Google Analytics Settings” variable as shown below.

google analytics settings variable

When you configure your variable, simply enter the UA property ID that you can find within the Admin section of your Google Analytics property.

That will do it! But if you need more help, you can check out this Google support guide.

What Do Our Trigger and Our Tag Look Like in This Example?

Let’s check them out below.

Let’s Create Our Trigger

As you can see in the screenshot below, we’ve created a Link Click trigger. After we hit the “New” button to create a new trigger, we’re prompted to select what kind of trigger we want to create. The options we have for the type of trigger to create look quite similar to the different kinds of actions we can track. For example, there’s a timer trigger, a scroll depth trigger, and various click triggers. We select the link click trigger (called “Click – Just Links”) for our purposes.

We can set this trigger to fire on ALL link clicks or just SOME link clicks. We’ll configure it only for some link clicks. This allows us to specify the specific conditions that we want. As you can see below, there are two conditions for our trigger. The destination of the click must be to the URL of the YouTube channel (the Click URL) AND the user must be on the homepage when they make that click (the Page URL). So any clicks from this page to the YouTube channel, would not cause this particular trigger to fire.

Let’s Create Our GTM Tag

We can create a tag in GTM by hitting the blue “New” button within the Tags menu (accessible from the left-hand navigation).

The first thing to do is create the type of tag we’re going to be creating. This tag is for event tracking for our associated Google Analytics (UA) property, so we select “Google Analytics: Universal Analytics” as our tag type.

The track type is “Event”. Then it’s time for us to determine our event parameters. The information we enter here is precisely what data will flow into the linked Google Analytics account when our tag and trigger fire. Once we’ve completed that step, we need to define the parameters of our event. Remember, these parameters are precisely what data will flow into Google Analytics. If you have different naming conventions you’d prefer to use, have at it!

Define Our Event Parameters: Category, Action, and Label

The Category is link-click. Every time this tag sends event data into Google Analytics, it will include “link click” as the name of the Category within the event parameters.

The Action looks a little different as compared to the Category. The curly brackets {{ }} indicate a Google Tag Manager variable. A variable is something that has the ability to send different types of data based on the specific event action taking place. The name of the variable is contained within the curly brackets. So our {{Click URL}} variable means that every time the tag fires, the specific destination URL will be sent into Google Analytics in the Action event parameter. In our case, we’ve used our trigger to limit the click URL only to the YouTube channel, so that is the only URL that will populate. Had we not applied this limiting Click URL filter on the trigger, any click URL from the homepage could have populated in our event tracking data.

The Label is another variable. As with our event Action, the name of our Label variable sits within those curly brackets. So our {{Page URL}} variable means that every time the tag fires, the specific page that the user was on when they clicked over to YouTube will be sent into Google Analytics in the Label event parameter. In our case, the trigger only fires from clicks on the homepage, so that is the only URL that will populate. Had we not applied this limiting Page URL filter on the trigger, multiple URLs could populate here in the data we see in Google Analytics.

google tag manager tag

Finish Configuring Our Tag

The fact that Non-Interaction Hit is set to “True” means that our bounce rate will not be affected when this specific event occurs.

The last field shows the Google Analytics Settings. This is where we associate our Google Tag Manager container code with our Google Analytics property, so the GTM event data goes to the right place. If you’ve followed the steps above to create your user-defined variable for your Google Analytics Settings you are already in good shape. Simply select the variable from the drop down menu.

Our Tag and Trigger Together

The last step is to select a firing trigger for our brand new tag.

You’ll see a directive from GTM to choose “Choose a trigger to make this tag fire”. Click into that space and go find the Trigger you built above. Once you’ve selected it, you’ll have a tag combined with a firing trigger as shown below.

tag and trigger together

Last Steps

Congratulations! You (hopefully!) now know a bit more about GTM than you did before. Tag Manager can be confusing and overwhelming, but if you can grasp the concept of tags and triggers you can understand the primary way in which the platform works. Bravo!

If you’re interested in more digital marketing tips and guides like this, head on over to YouTube and subscribe to the Root and Branch channel. There’s normally at least few new analytics and SEO videos with tips and guides each month.

click to yt

Final Thoughts

If you have questions about these Google Tag Manager basics or suggestions of your own tips to share, feel free to drop them in the comments below or share on LinkedIn.

Thanks for reading and have fun with those tags and triggers!

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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