Join Corey Koberg for an in-depth discussion in this video Installing your first container, part of Google Tag Manager (V2) Essential Training.
You need to consult with your administrator or developer to see how you can best get this code snippet on your page. Now, perhaps, it's an include file. Perhaps it's a plugin. Maybe you're going to paste it one by one. The only thing that is the same for everyone here is you need it to be right after that opening body tag. Let's take a look at how you might do that, well, for an individual page, anyway. O.K., we've got our HTML code here. We see we have this opening body tag right here, and we're going to place that snippet directly after that.
So here's our Google Tag Manager snippet right after the body, and we can go ahead and save that, and I'm going to FTP it over the server. O.K., now keeping in mind I've done that to just one page here, this is going to be our example. You're going to want to do that for each of your pages. O.K., now we're going to go to our website and check it out.
O.K., we come here to our website. We reload the page. Now of course we don't see anything because this code is running in the background, and what we're going to do is do a View Source instead, and, of course, here we see our Google Tag Manager code. Now, so far so good, but is this code actually really running? One of the things we can do is check with a tool like WASP to see if anything is actually being loaded here. We'll go through the WASP Chrome Extension in more detail later in the course, and it's not really necessary here, but it can be helpful for validation, so if you'd like you can just download it by searching for WASP on the Chrome Store.
Note that a new icon is being rolled out soon, so it may look slightly different in your browser, but the functionality works exactly the same. (mumbling) my WASP console. Reload the page. Sorry, I should come to to the website itself. Reload the page. I don't see anything coming from Google Tag Manager here as far as scripts that are loaded. Well, another thing we can do is come here and check the network one here. This is going to show all the things that are loaded from the network, and we can filter this out for tag.
O.K., here we've got the call to Google Tag Manager, but what we're seeing is a 404 Not Found, and that's because we haven't actually pushed anything into the container yet. We put a snippet on here that's going to call for the container, but since we haven't published anything on here we're going to get a 404. We haven't actually pushed anything to the site yet. Remember with Google Tag Manager it's not just about putting the code on the page. It's about pushing it out via the central management system, so let's go back and take a look at this. Come back to our container home here. We see it's Container Not Published, so right now we're not going to have anything that's going to be published out to the site, so what we can do is go ahead and publish this essentially empty container.
We publish that out. Now it does take just a few seconds for this to get through the server. It's normally instantaneously, but sometimes it does take a second or two for that to go live, but for the most part as soon as you publish that it is going to be alive. We see we have one version published here. It has no tags on there, but we are hopefully going to at least see that this is going to load the container itself. So refresh this, and sure enough, here we're going to see Google Tag Mangers GTM.JS is going to load. We got a 200 O.K. Switching over to WASP.
We see something similar here. We have Google Tag Manager loading the GTM.JS as well as the GTM Data Layer. O.K., we'll talk more about the Data Layer later, but that's going to be one of the signs that Google Tag Manager is actually executing, it's not just loading, and so that's it. We've created, deployed, and now published our first Google Tag Manager container. I'll remind you again that you need to make sure that the code is on each and every page. Usually, there is a way in most content management systems to do that somewhat easily. I'll take a look at one of the more popular ones by way of example in the next video.
This course provides the skills to get up and running with Google Tag Manager quickly. It explores how to set up Tag Manager accounts and containers, use turnkey tags, create rules and macros, control versions and user access, debug tags, configure custom tags, and add code to capture specific Google Analytics events. Authored by GTM expert Corey Koberg, this course also provides crucial, time-saving best practices for working with Tag Manager.
Note: to keep the training as universal as possible, we use the nonmobile version of GTM, and configure it for a generic WordPress site. Your specific implementation will be dependent on how your site is coded.
- Creating an account and container
- Installing containers
- Using built-in tags from Analytics, ClickTale, and other services
- Working with variables
- Firing events with triggers
- Creating versions
- Using custom tags
- Implementing a data layer