From the course: Learning Google Tag Manager

Efficiency bonus: Google Analytics built-in tags - Google Tag Manager Tutorial

From the course: Learning Google Tag Manager

Start my 1-month free trial

Efficiency bonus: Google Analytics built-in tags

- [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. So these are built in turnkey tags where you simply enter some info, and it does all the heavy code lifting for you. And while GTM can deploy just about any type of tag, it's no secret that the most popular tag by far is Google analytics, which we often just referred to as GA. And this makes sense since despite its simple base configuration, a reasonably sophisticated GA tag can get complex really quickly. So we're going to look at the GA tag in this video. And it's going to serve as an example of these built in tags. And also hopefully, help you tackle one of your most pressing GTM needs right off the bat. Now we're also going to revisit this tag in other videos as we're going to add some complexity such as triggers, variables and a data layer. Okay. Now, previously we had installed our container and did exactly nothing else with it. There were no tags, no triggers, no variables. It wouldn't even let us publish it. So let's fix that and take this opportunity to publish our first tag to the site. So we come here and we click on new tag. At the top here, we see our tag configuration where we choose the tag type and at the bottom is going to be our trigger that's going to tell it when to fire. So let's first choose the type. And we see a few different Google analytics options right off the bat. A few betas. We're going to go ahead and select the standard universal analytics. So we have that as a tag type. The next thing we need to do is look at track type. Now we have a few options in here, events and transactions but we just want to use plain old page view, we're just trying to track when someone views the webpage. And the next thing we have to do down here is some Google analytics settings. And we're going to tell it which account to send this data to. So we need to tell our Google analytics account. We can do this via variables and we'll do that later but we don't know those quite yet. So we're going to select enable override settings and we're going to manually put in our Google analytics tracking ID. You have to get this numbers, reminder, we're going to have to go back to our Google analytics. Come down here to the admin, come over to the property, click tracking info and then click tracking code. It's then going to give us this tracking ID here. We're going to take the entire thing and copied in with all the letters and dashes and everything. And then we're going to come back and just paste that right down here into tracking ID. Okay. Now we've got a few more settings down here that we can take a look at. These are going to be specific to Google analytics. These are not actually part of Google tag manager. They are specific to GA. They're really only here because GTM has this GA template. So knows all about the GA tag. It knows about custom dimensions and metrics and groups and other things you can do with eCommerce. Another example here would be this advertising flag. We want to enable display advertising features and we can set that too true here. We set the true it's going to enable the campaign manager data and integration within Google analytics. So if you want to get demographic reports, interest, affinities, remarketing with Google Ads, that kind of thing, you can set this to true here and it will automatically adjust the tag. Now, you should probably click that question mark here. It's going to have some information on privacy policies if you actually decide to use this. But of course, we're just using this as an example here. The point here is we can set these features right within GTM and there'll be included in the tag. Okay, now, if this were a simple GA-based tag, that's it. We just go ahead and save this. And then we're going to add a trigger because we need to tell it when to fire. And that's easy. We want it to fire on all pages. Every time a page loads, we want it to fire. So we have our type of tag here, a few settings and our triggers. Let me go ahead and save that here. And we're going to need to give it a name. And you can name whatever you want. I prefer to first have the service. So I'm going to call this GA and then what it's doing. So we're tracking page views, and then what type of tags so what base tag has my convention? Okay, we save that now we see that we have a tag here and we need to publish this. We can come up here, click on submit. We can add a descriptive name. We can base tag. Give it more description down there. Go ahead and click publish. And it's going to publish this out. So this will now be live on your site. So we go over here to our site, we refresh the site and this is going to fire. Now, if we want to verify that, we can use a tool. For example, I like to use the WASP tool here. If I open up the WASP tool down here and I reload the page, what I can see are the tags that are loading on the page in the background. One of those, of course, we see here as Google tag manager this loads, something called gtm.js which then fires this Google analytics tag here. And if I take a little closer look here, I can look at what's happening here inside of the GA tag. And we see that it is firing something called the collect script. The collect script, if I look at that, it's going to come in here and there it is. I see our ID that we had just pasted in there. So we know for sure this is working properly now. Now, if you just simply want plain vanilla Google analytics installed with no events or eCommerce, then you're pretty much done with tracking code for your site. But GTM can do so much more than just install GA. We'll take a look at some of those other tags in the next video.

Contents