Adding Your Basic Google Analytics Tag Through Google Tag Manager
. So just to reiterate and not to reiterate this too much. Make sure this tag is globally on your site. Going back to the container section, we go over to tags and now we're gonna add our very first google analytics tag. First thing you do is click new and the first thing you see in this layout is that you have a whole bunch of pre built integrations with all these different products, you have google analytics, you have adwords, you have double click, you have things like comscore marin. Admiral. Crazy egg turn linkedin. And then you can even go down you see a whole bunch more. So it's really cool. And google is continuing to add these different integrations that are pre built That allow using these 3rd party vendors to be a really simple, easy and effective process through google tag manager. Let's first name our tag. So because this is going to be our basic google google analytics. Page view tag we're going to name this. I'm going to name this google analytics base. Um and I'm gonna call it because you'll see um as once we start saving and adding additional tags we're gonna have a whole list of tags and I'd like to have them organized in a really effective way. So you might want to use your own naming conventions. But I like to have it numbered so I can see them in order of importance to me or in order of the hierarchy in which I added them. So I'll call the 00 will be at the top G. A. For google analytics and this will be a base tag to indicate that this is just the basic page view tag and nothing more. So I'm gonna go ahead and select google analytics and then I have to choose a type of tag. We have classic google analytics and universal analytics without getting too deep into the difference between the two the tags that we're adding via google analytics are the is the google universal analytics container tag. So we're going to select that and it's pre selected for us. And now we're gonna have to configure the tag. All we need to do is get our tracking I. D. So we simply go over to back into our google analytics account. We go over to our admin section like you know how to do we click on dot Js. Tracking info get our tracking code and over here we have our tracking I. D. Once again similar to the Wordpress plug in you don't have to go ahead and add your entire tag. All you need is this tracking I. D. And google analytics and google tag manager they know everything else. So we're going to paste that right in and we're gonna click enable display advertising features. That's not something you have to check off. Now when we're creating this base tag but it will become handy later on track type page view. Page view is pre selected. That's the basic type of tracking we're doing. If we were to track an event let's say in the next lecture we're going to set up an event which is a custom button, click event. If somebody clicks on and say the contact button of a form we want to send an event back to google google analytics without google tag manager setting up an event is pretty tricky. You need to go back into the custom html of your page and hard code the event data and the event parameters. Google tag manager, google tag manager. It takes all that extra work out of the process. But for now we're simply setting up a google analytics. Page view tag which is going to just simply track page views and of course with page views you track time on site and sessions and returning visitors. This is the basic google analytics tag really just mimicking. If we would have added the full google analytics code hard coded into our website like we did in the previous lectures. There's a lot of additional settings here. If you twirl down the more settings, Twirly menu you have a whole bunch of different um advanced features like e commerce features, cross domain tracking advanced configurations. We don't need to do any of that stuff now and we don't need to really work on any of the advanced settings, options and priorities, priorities over here. So we're going to roll that back up. We didn't really mess around with anything over there. We just select page you and then we're gonna click continue fire on is the next and last setting that we have to configure. Going back to what we spoke about in the previous lecture. This is what the trigger is. We have this tag. So basically what we're doing is we're telling google tag Manager is to put the google analytics tag on our website. Just put it there. But now we're telling them what to do with it. When should it be active? Should we be tracking page views on some pages on a click? Um on we could add additional custom triggers but of course for now because this is our remember this is our base google analytics tag, this is the fundamental google analytics page view tag So we wanted to simply have it on all pages. This is the same thing that we spoke about as having this as a global tag. You know, we were very concerned about putting this tag in the footer or header to make sure it showed up on every single page of our website. So this is really what we're telling google tag manager now I want this tag to be global and I want this tag to fire on every single page of the site. So I'm gonna go ahead and click all pages and then I get this nice little notification that this trigger will fire tag on all pages and you can create exceptions. Remember we spoke about it let's say we didn't want that tag to fire on just our contact us page so you can create those exceptions and modify that trigger over here but we're not gonna do that. So we're simply gonna create the tag and that's it. Our tag has been created but it's not published and this is a really important aspect to google tag manager, just creating your tags and associating a tag with a trigger, which we just did. That doesn't mean that the tag is active on your site. You have to go ahead and actually publish the container. But before publishing the container, which is what you do up here in the upper right hand corner, this big red publish button, it's always a good idea to preview that tag. So if you select the drop down and you click on preview and debug your google analytics container is now in preview mode. Now check out what happens if I go to my website in this in the same browser that you have opened your Google Tag Manager account. So we're gonna go to Adventure PPC dot com. And as it loads, you see you got this really neat drop down over here that tells me what's happening with google tag Manager showed It showed me is a summary of tags fired on this page and tags not fired on this page. So we see here that are 00 G. A base tag would be firing on this page if this was a published container. Keep in mind this really cool google tag manager preview only shows up in the same browser window. If I were to open up, let's say a Safari window and go to our website, we're not gonna see that google tag manager preview state come up, it's going to be our normal website. So that's something which is important to keep in mind. So we have this tag fire on on this page now. Just just as an example let's say we were to go back and we were to modify the trigger for this tag. Okay. So let's say we were to say that we only instead of firing on all pages we're gonna edit this trigger and we're gonna fire it on click. Okay? So we're gonna fire it. The event is going to be a click and will any element will target any element? Um It could be a button, it could be just clicking the mouse. Any element will be targeting that click continue to fire on all clicks create the trigger. Well let's name this trigger for now. All clicks and click save. Okay. And we're gonna remove the all pages trigger and now we're gonna click safe tag. So now over here are firing trigger for this base tag is no longer all pages it's now all clicks. So let's say we have to go down and we click preview again and I refresh this page. Watch what happens and there's gonna be a very important difference. As you can see we haven't fired our google analytics based tag yet because now instead of it firing on a page view like we had previously it's going to wait for a click to fire. So now let's say I go ahead and click on this button here. Watch what happens down below immediately we fired this google analytics tag and now it's going to start sending back data to google analytics about my visit before I clicked there was no trigger that fired this tag. It was waiting for a click as opposed to how we had it set up before, as long as there was a page view, as long as the page loaded it fired a tag, which is what you want. So let's go back and switch this trigger back to what we had before. So we click on that that tag again we go back to our fire on which is our trigger and we remove all clicks and we select all pages and we saved the tag and now we're now we're back to firing the trigger on all pages and if we go down and we preview it we go back and we refresh our page. Google Tag Manager no longer is waiting for a click, it's going to fire that tag right away on page you which is exactly what we want to do. So now that we have it working the way we like it. I'll go to a couple different pages here, let's say, I go to a monthly PPC management and I want to make sure that that's just firing. Okay, great, it's firing on all the pages. I go back to google tag manager and most importantly in order to make this active, I have to click publish, I'll click published. Published. Now. Done. Now a tag is published and now we just need to leave preview mode, click OK. And everything that should be working as it will. So now if I go back and refresh this page are google tag Manager preview will no longer be popping up, we're just gonna have a regular website but everything should be running as we wanted to. So that's exactly how to add our google analytics base tag to our page. Now we're going to go ahead and set up an additional tag that's going to send a custom event back to google analytics. And this is going to be really important as it relates to a lot of our re marketing campaigns because as we've been talking about throughout this entire course, understanding what actions a user takes on your site represent a different level of engagement or that there or that that customer is in a different stage or in a particular stage of the buying funnel is really important when it comes to creating these remarketing audiences. Oftentimes and we get this from our clients all the time when the user clicks on a certain link or they click on a certain button that represents a very good visitor and that represents a certain level of engagement over and above a normal conventional page view. However, before google tag manager, if you were not a coding guy. If you're not a developer, it was really difficult to set up custom events in google analytics, you had to actually know some code, go into the html of your page and set up proper event tracking through the actual back end of your website With google tag manager. We have the amazing simplicity of setting up these custom events to be able to use now re marketing campaigns right here through google tag Manager. So that's what we're gonna do in the very next lecture setting up a custom button event. It's gonna be really cool. Thank you very much for watching this one and I will catch up with you in a few seconds in the very next lecture, talk to you guys soon.