Beginner’s Guide to Google Tag Manager:Tags, Triggers, Variables and the Data Layer
In my opinion, the most exciting skillset in digital marketing to develop is tracking key metrics that impact your client or your company. This is mostly due to the fact that it’s a constant challenge to learn new metrics to be trailed, but I’d be remiss if I didn’t mention it’s also because your coworkers and clients will be amazed at the marketing wizardry you pulled off to get the data. Or at least they assumed it’s marketing wizardry. In all honesty, anyone can do it – even you.
The main component in tracking key performance indicators (KPIs) within your Google Analytics (GA) account and eventually Data Studio account, is Google Tag Manager (GTM). We’ve mentioned this in previous blogs, but it’s important to think of Google Tag Manager as the platform that collects information, Google Analytics as the platform that stores information, and Google Data Studio as the platform that reports information. Google Analytics has the ability to collect information, but the information is fairly vague. Within GA you can collect pageviews or general conversion metrics that will be helpful as you optimize your website. However, Google Tag Manager allows access to those deeper insights. Think about firing specific conversions only if a certain dollar amount is reached in the cart. Or perhaps you want to know how far down someone scrolled on those pageviews of yours. That’s where GTM can become your ally. Furthermore, Google Tag Manager is compatible with a number of popular third-party marketing tools from Hotjar to Facebook and more, making your everyday life of tracking KPIs that much easier.
In this blog post, we’re going talk about how Google Tag Manager runs, from tags and triggers to variables and the data layer, as well as a few other awesome integrations GTM can offer you or your marketing team. Did I mention it’s free software too?
Per usual, before we start, I must give Chris Mercer from Measurement Marketing a quick shout out as I gleaned information from his course at CXL Institute, and his course goes into even greater detail on the subject if you’re interested.
What are Tags?
First and foremost, you wouldn’t have Google TAG Manager (GTM) without actual tags would we? If there were a who, what, when and why of GTM, then GTM would be the who and the tags would be the what. Tags will tell your Google Tag Manager container what it is that needs to be tracked specifically and for what platform. In technical terms, the tags are scripts that would appear in the header or body of your HTML if you were coding the site. These scripts tell GTM to fire at the appropriate time based on what specifically you’re hoping to track. Let’s look at a few examples of tags in GTM.
On the left, we see a few tag options that are based on Google platforms. It would make sense that a Google product would feature its own products to integrate with, but as we’ve mentioned before there are options with other platforms such as Hotjar, LinkedIn, Facebook and even Pinterest of Quora on the far right. The key here is the middle image that says custom HTML and a custom image. There are dozens of built-in integrations that will allow you to build tags using other platforms, but what if there is no integration for the platform your using? Maybe you’re using Salesforce Pardot (which at the time of this writing I believe does not have an integration), you can always use custom HTML to tell Google Tag Manager what you want to do. In these cases, you might need to help of a developer, so don’t be afraid to raise your white flag and ask for help!
What are the Triggers?
Okay, we’re back to our who, what, when and why analogy. Triggers are your when in this equation. Triggers allow you to tell Google Tag Manager when you want it the take an action. Let’s think about this with a very simple example. You can state that whenever a pageview occurs, I want GTM to fire Google Analytics, Facebook, and Hotjar tags. You can also take it up a notch here with conversions. You can tell GTM whenever your prospect converts on a thank your page, you’d like the Facebook, Google Analytics and Google Ads tags to fire. Similarly to tags, there are multiple triggers that you can choose from.
There are three types of triggers that can be used in GTM – pageview triggers, user engagement triggers and click triggers. Pageview triggers measure when the page is loading and the numerous stages of loading. Click triggers can track hyperlinks or URLs throughout different pages and user engagement triggers measure great engagement metrics like scroll depth, form submissions, YouTube video views and when certain elements load on a page.
What are Variables?
Google support defines variables as, “a named placeholder for a value that will change, such as a product name, a price value, or a date.” Variables are often misconstrued with triggers and here’s why. A variable is simply extra information that can be provided to GTM to correctly do its job. Variables don’t tell GTM when to fire as a trigger does. Let’s think about our previous examples of pageviews and conversions.
In the case of pageviews, different variables can be added to specify information about the exact pageview. For example, it might be important to recognize what page the pageview occurred on and if your account holds multiple domains, which specific domain that pageview happened as well. The tag is going to fire regardless of the page it fires on, though it might not relay what page it fired back to Google Analytics if it’s not set up with a variable.
In the case of conversions, it’s certainly great to know that a conversion happened on your site, but GTM variables will take it one step further by identifying what the product might be, how much the payment amount is, or even interesting information related to the cart. The tag is still going to fire regardless of the amount of money associated with the conversion or which product the conversion is associated with, though again it might not relay that information back to Google Analytics if there is not a proper variable in place.
In our who, what, when, why analogy, I like to think of variables as the why because it often tells me the finite details, which is why I’m using GTM in the first place. Per our conversion example, why am I setting up the tag in the first place? In that case, I’m setting it up because I’d learn how often people are buying a specific product and how much revenue I’m accruing due to those purchases, which are only available by using GTM variables.
What’s the Data Layer?
Mercer makes an excellent analogy for the data layer that I think is useful to always keep in mind. The data layer is essentially a little virtual filing cabinet that temporarily stores important details for each of your site pages and GTM. As you’re tracking engagement throughout the site, the details of those engagements have to be stored for you to review right? That’s where the data layer comes in. Each data layer has keys and values which could be equated to folders and the contents of each folder within our virtual filing cabinet per Mercer’s analogy. A few examples of these can be found below.
Each time a page with GTM scripts loads on your site, a brand new data layer loads on the page with the necessary information needed for GTM to work properly. When you’re ready to publish your first tags, you can look at preview mode (which we will dive into next week) to look at what your data layer looks like and how it changes as you navigate throughout your website.
Google Tag Manager is an incredibly powerful tool that every organization with a marketing website should be used to track website engagement properly. In the next post, we’re going to talk more about, preview mode, setting up tags and go deeper into how GTM can change KPI measurement for your team.
In the meantime, have you started using GTM on your website? What tags are you using and why? We’d love to hear how you’re optimizing your GTM account to better suit your business and clients.
This post was created in an effort to complete my CXL Institute Minidegree Scholarship obligation and speak to the materials reviewed in the course. The information is a combination of my previous knowledge and excellent insights from a phenomenal program.