Join Corey Koberg for an in-depth discussion in this video Leveraging the Google Analytics built-in tags, part of Learning Google Tag Manager.
- [Instructor] One of the advantages of most tag managers, Google's included, is they can simplify the process of deploying tags by having them templatized. These are built-in, turnkey tags where you simply enter in some info, and it does all the heavy code lifting for you. And while GTM can deploy just about any tag, it's no secret that the most popular tag by far is Google Analytics, which we refer to often as GA. And this makes sense, since despite its simple base configuration, a reasonably sophisticated GA tag can get complex very quickly. So we're gonna look at the GA tag in this video, which'll serve as an example of built-in tags and also hopefully help you just tackle your most pressing GTM need right off the bat.
Now, we're also gonna revisit this tag in other videos, as we're gonna add some complexity, such as triggers, variables, and data layer. Now, previously, we installed our container and did exactly nothing else with it. There were no tags, no triggers, no variables, so it wouldn't even let us publish it. Let's fix that and take this opportunity to publish our first tag to the site. So we go here, there's New Tag. Now, it says we can choose from over 50 different types, so that's exactly what we're gonna do. The first thing we're gonna do is choose a type. We've got Google Analytics here, a couple choices. We're gonna choose Universal Analytics.
And the track type is a page view. We could also do events and other things, but we just want to track a base page view right now. The next thing we need to do is give it some information, such as our account number. Now, we can do that here with some variables. We haven't gotten into variables quite yet, so instead we're going to enable override settings here, and we're gonna paste in our ID directly. Now, this you're gonna have to get Google Analytics. And just a quick remember, you go into your Admin here, and you're looking for this UA number that we've got here. And you want all of the UA, the middle number, and the end as well.
So, in our case, we're gonna go ahead and paste that in here. Now, to be honest, hard-coding this into the tag is not really the best approach, but it's something we're gonna update later when we talk about those variables. Okay, now we've got a few more settings down here that we can do that are specific to Google Analytics. Now, these are not part of GTM. They're really only here because GTM has this template, and so it knows all about Google Analytics. So it knows about custom dimensions and metrics and groups and things you can do with ecommerce. And, for example, this advertising one, we can enable display advertising features, and we can set that to True.
This is gonna set flags within Google Analytics. Then, normally GTM doesn't have anything to do with this, but because this template has all the different configuration options for Google Analytics, these are going to be included here. So this Enable Display Advertising Features, this is one that's gonna enable the DoubleClick data within GA. So if you want to get demographic reports and interest, affinities, remarketing with AdWords, that kind of thing, you have to check it here, and this is gonna automatically adjust that tag. I would recommend enabling this, but first, depending on what country your company is based in, it'd be worth discussing privacy laws and whether you want to collect this information internally.
For example, if you're in the EU, to collect this kind of information, you have to have public-facing declarations, privacy policies on the website itself. You can get a bit more information here just by clicking the question mark. But the point here being we can set these features right here within GTM that will enable us to have this included in the tag. Okay, for a simple base tag, that's it. So we're gonna go ahead and save this. Now, this one's gonna say we don't have any triggers about 'em, so we need to add a trigger. And the trigger we want to add is All Pages. We want this to fire on every single page.
We're going to save that again. Now, we need to give it a naming convention on this one. The convention that I'm going to use on here is the service and then the tag type, and then the description is what we used in the past. So this is Google Analytics, it's a page view, and this is our base tag. So we're gonna go ahead and save that. And it says here that we have a tag now. Okay, so let's go ahead and make sure that's working. We're gonna come over here. We're gonna reload the page. Make sure it's opening our WASP, Control + Shift + I.
We're gonna reload the page and make sure that the Google Analytics tag fires. And we don't see it here. All right, now hopefully the astute among you caught that while we created the tag, we did not publish. You must publish that new version container for it to go live. Okay, so let's go ahead and publish this and make sure it's working. We are going to submit this change. Click Publish. We can give this a descriptive name.
Continue, okay, we come back here. And what do we see? Two additions. We see both the Google Tag Manager right here, that we are loading that, and we see that we are firing off our Google Analytics tag. Okay, so we've now published our first working tag, and we are sending data back to Google. For some of you, this might be it. If you have plain vanilla Google Analytics installed with no events or ecommerce, then you're basically tracking your site. But GTM can do so much more than GA. We'll take a look at some of those other tags in the next video.
- 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