Join Corey Koberg for an in-depth discussion in this video Understanding the GTM hierarchy, part of Learning Google Tag Manager.
- [Instructor] At the heart of Google Tag Manager is the container. This is what's going to contain all of your scripts and tags the system will inject into the page. To understand why this is important let's look at the older model. Each webpage has the underlying HTML and scripts that render the page into what we see on the screen in the browser. This may include analytics tracking scripts, Adwords conversion scripts, retargeting scripts, marking automation scripts, video tracking, special transaction tracking scripts that only go on certain pages once a transaction has occurred, and so on.
Which scripts and tags get loaded isn't decided back when the code is published to the website, but in real time when users load the page on the browser. This is a much cleaner structure that also gives you enormous flexibility in terms of what to load and under what circumstances and conditions you will fire those various tags. Now, while this container itself is the main workhorse, there's more we need to understand. The container that sits in these pages holds three types of entities, tags, triggers, and variables. Tags are the code snippets that collect and manipulate the data.
The most common example of this is your web analytics tags, but there are literally thousands of these tags that perform similar functions. Some are already built into Google Tag Manager's templates, but you can create your own custom HTML and image tags as well. There are an ever increasing number of these turn key template tags being added as GTM grows, and it really is a good idea to use these templates as they're much less complex to use in a snippet that the vendor may provide directly. Triggers are the rules and conditions that you will specify to GTM to tell each tag when to fire.
For example, you may have a trigger that looks through your thank you page URL and then fires the various conversion tracking tags. Variables are bits of information that can be stored and accessed by your tags and triggers. Some are automated and populated by GTM, such as the value of the URL and some can be populated by the user, such as your specific account numbers or even dynamic values such as the amount of money spent in a transaction. GTM is a tool that exists within the Google stack and it leverages Google's single sign on authentication, so once you register with Google using either a Gmail address or any other account, perhaps your work account, you will be able to access Google Tag Manager and get started.
We'll go through that in a bit more detail later on. You can also have multiple containers, as we see here, most commonly one container per website or domain. Each container will hold its own set of triggers, tags, and variables. These containers all are accessible, viewed at one GTM account and that one GTM account is going to be accessed via your main Google login, also known as a Google account, here by my email address. In this example, our single Google Tag Manager account, Cardinal Path Primary, is accessed via our Google login, Corey@CardinalPath.com, and it holds two containers.
The first is for the www.CardinalPath.com domain, and the second is for CoreyKoberg.com. This difference between a Google account, which is your login, and the Tag Manager account is very similar to those of you who are used to having a Google login and it's separate or even potentially multiple Google Analytics accounts or Google Adwords accounts. Same idea, you log into Google once and then you have all these different services and accounts that you can utilize. Okay, let's take a quick look at the interface and how this all fits together. What we want to do here is go to tagmanager.google.com.
What we see here are the various accounts that my Google login has access to. For example, we have here Lynda, we have Cardinal Path Test, and we have another Lynda account and a Two Trees one down here at the bottom. Inside of this account here for Lynda, we have one container, that's the Hansel and Petal, you can see the container ID over here. If I click into the container itself, we're going to see the dashboard here and on the left we can see the tags, the triggers, and the variables for this container.
Now that we have a lay of the land, the next few videos we're going to create our first set of these from scratch and put this all to work.
- Working with accounts and containers
- Installing a container on WordPress (CMS)
- Leveraging the Google Analytics built-in tags
- Working with variables
- Creating triggers
- Control versioning
- Debugging your tags
- Using custom HTML tags