Today you’re going to learn how to install Google Analytics onto a WordPress site using Google Tag Manager. There’s probably two reasons why you’d want to be doing this, the first is pretty obvious, you haven’t installed Google Analytics yet and you’re doing it for the first time. The second might be that you’ve installed Google Analytics but it looks like the installation went wrong. Maybe pixels are firing in the wrong way,or you want to consolidate your pixels into one place with Google Tag Manager, or you’re using Google Tag Assistant and it’s firing a bunch of errors at you. We’re going to go through the exact step by step process that you need to install Google Analytics onto a WordPress site using Google Tag Manager. 

google analytics to wordpress manually

Make sure you stay for the whole video to see exactly how that’s done. I’m Tommy Griffith with, let’s get going. Adding Google Analytics to a WordPress site using Google Tag Manager. We’re going to be using an SOP from the ClickMindedSOP library for this one. SOP stands for standard operating procedure,it’s just a fancy way to say a really comprehensive checklist. We have a ton of digital marketing SOPs on our website at This one will take about 15 to 30 minutes to pull off.

Let’s just do a quick high level overview of how to get this done before we get started. What is the goal? The goal is to add Google Analytics to a site using Google Tag Manager and verify that it’s working properly. The ideal outcome is that Google Analyticsis properly installed and added to your site without any technical issues. 

Prerequisites on this one, you can only do this if you’ve installed Google Tag Manager. If you haven’t done so already, you’re going to want to do that. We actually have a video for you on exactly how to do that down below in the resources if you want to do that now. Why is this important? Well Google Analytics is the most popular way to measure traffic on your website, to gather data on your visitors. Once you’ve done this you’ll be able to know exactly how much traffic you’re getting and how your visitors are behaving on your website. The vast majority of people should be using Google Analytics. 

how to add google analytics to wordpress manually

There’s very few cases where you wouldn’t at least have it installed. Where is this done? When is this done? This only has to be done once, so you set up Google Analytics one time and the rest is taken care of for you. Who does this? This will be whoever is responsible for managing your website or managing analytics or it might be you. First you need to sign up for a Google Analytics Account if you’ve not already done so. You can head over to to get that going. If you haven’t signed up for an account yet you’ll see a wizard that says, “Create an account, start here.” Go ahead and click that button and that takes you into this new account flow. 

First it’ll ask you for your account name,then your website name, then your website url. For a lot of people account name and website name will be the same. Where this might differ is if let’s say you’re setting up a company and then that company has multiple domains underneath it, in that case you might have an account name and then multiple website names underneath. If you’re just one account and just one website then these will be the same. It defaults you to a website versus a mobile app. We’re going to stick with a website for this one so our account name is going to be our demo site, a site about emojis. Our website name is the same thing that’sa site about emojis, it’s a great name. 

Our website url is Your industry and category doesn’t matter too much, it’s just kind of more information for Google, you can set your time zone. Google defaults you to all of these options here. They have them checked by default. I usually uncheck them. Don’t share the data with Google. 

It probably doesn’t matter all that much either way, but I like to opt out from giving Google data when I can and go ahead and click get tracking ID. I got to sign my life away to their terms of service so accept that and there we go. We are now in the section of Google Analyticswhere it gives us our tracking code. If we were just setting up the site normally without Google Tech Manager we might take this and paste it into the body of one of our site templates in WordPress. 

We’re not going to do it that way, we’re going to do this a little bit more technically through Google Tag Manager. What we want to do here is make sure we copy the tracking ID, so you go up here, grab the tracking ID and copy that to your clipboard,and we’re going to use that a little bit later. We’ve set up Google Analytics with our website,we’ve copied our unique Google Analytics ID to our clipboard. Now we’re going to head over to Google TagManager and add this in. Head over to If you haven’t set up Tag Manager yet we actually have a resource for you on exactly how to do that below. You can go ahead and click that in the resources section to get that going. 

Once you’ve logged into Tag Manager, on the left hand side click tags, come up here to new, and under my name I’m going to go ahead and remove the untitled tag and I’m going to give it a name. You want to think a little bit about your naming convention. If you start to add a lot of tags to GoogleTag Manager it makes it much more straightforward and easier to navigate in the future when you get a lot of them in there, if you pick a really clear, easy to follow naming convention. For this one I might use the convention GA,for Google Analytics, so GA_trackingcode, maybe something like that. 

Then under tag configuration I’m going to mouse over here and you see a little pen shows up in the top right hand corner. I’m going to click that, I’m going to look for Universal Analytics. It shows two different options. A Universal Analytics and classic Google Analytics. The vast majority of people are going to be using Universal Analytics, this is the more updated version of GA, of Google Analytics. 

Nine times out of 10 you’re going to be using this one so go ahead and click Universal Analytics. We’ve selected Universal Analytics. Now we’re going to come down here under settings,click new variable, and remember that tracking ID we pasted from a little bit earlier, if you’ve still got that on the clipboard you can go ahead and paste it in. I’ve pasted that in, I can click outside the box, go up to the title, and give it a name that’s easy to follow. Something like GA Tracking Code might work,go ahead and hit save. 

We’ve setup the variable here, now we’re going to setup the actual trigger that determines when this gets fired. We’ll mouse over on the bottom under triggering and we’re going to click the little pen in the top right hand corner. If you already have some there that’s fine,we’re going to setup a new one just to show you how it works. 

how to add google analytics to wordpress with a plugin

In the top right you click the little plus,and under trigger configuration again we’re going to go for the pen in the top right,and we are going to go for page view. We’re going to do page view, all page views,and we’re just going to call this all page views. What this means is we’ve setup the variables related to our Google Analytics ID previously, now we’re deciding when that variable gets fired and that will be during all page views as we’ve dictated here. 

Go ahead and click save. There we go, so Universal Analytics set, pageview, we have our Google Analytics tracking ID that we pasted in, it’s going to fire on all page views, and we’re going to go ahead and click save. Once you’ve hit save you’ll be back in GoogleTag Manager. You’re not done yet though. You’ve saved it to Google Tag Manager but you actually haven’t published to the real world. If you go into your dashboard you can actually sort by last edited. We have a bunch of stuff going on here butI sort by last edited and you can see the last one was changed just a few seconds ago. 

You can also see here workspace changestoo. That means there’s two new things in the workplace that have not yet been submitted. I can go ahead and click submit and do a versionname, so I can be descriptive here about what’s actually changing in Google Tag Manager so that in the future if someone else is working on this they know what was changed. Version name was adding Google Analytics,might be one or you could call it V5, adding Google Analytics, whatever it is. 

We’ll just stick to adding Google Analytics. This update contains Google Analytics installation,something like that. Go up and hit publish. It’ll do some thinking and then we are now live, so Google Analytics is now added to the website via Google Tag Manager. Cool, so we’ve added Google Analyticspixel to our site via Google Tag Manager. We still want to verify and make sure that it’s actually working. 

If you head back over to your site you can open it up, and you’re going to want to use a Chrome plugin to validate that it’s working,it’s called the Google Tag Assistant Plugin. We have a link down below in the resources if you don’t already have it installed. Load up your site, make sure to open up that plugin, you can click enable, and then go ahead and refresh the page. You refresh the page, you open it up, and you will see our tag there, Google Analytics and Google Tag Manager are firing and working. That’s how to verify that Google Analyticsis working via the Google Tag Assistant Chrome plugin. 

There’s another way you can verify it as well. Open up your website or you open up in yourChrome browser. You head over to your analytics tab, and on the left hand side under reports there’s a section called real time. Go ahead and click real time and select overview and you should be able to see your impression showing up on Google Analytics. If you come back over to the site and refresh you should see it trigger momentarily here, boom, there it is. That’s the real-time action happening on the site there, just another way to verify your Google Analytics installation. We’ve signed up for a Google Analytics account,we’ve installed it onto our WordPress site via Google Tag Manager, and we verified two different times that it’s actually working. One through the Google Tag Assistant plugin,the other through the real-time dashboard in Google Analytics itself. Now if you come back into the admin you’ll see, through this view, you’ll see three different columns here. One’s your account, one’s your property, and the final one is your view. I want to talk a little bit about views for a moment here. 

The default that Google Analytics gives you is all website data. If you’re new and you’re just getting started and you just kind of want to set up Google Analytics and then walk away this might be okay, but eventually you’re probably going to want to create more views. We’re going to talk about the three core views you should probably have. The first is your main view, this is goingto be where you do the majority of your analysis, this should be working flawlessly, there should never be any problems with this. This will be where you’re doing your day today stuff, your main view. 

The next will be your staging view. This is basically your sandbox, your testing ground, this is where you run experiments, where you try stuff out. You’re allowed to mess this up because it’sa staging server, so this is kind of if you have a theory or a hypothesis about something,you want to test that out, you’ll do it here. Then the third one is your unfiltered view. You just kind of let this sit, you never really touch it, this is all your raw data and it sort of sits there and collects. You can always kind of backup to this. You create these three views. One is sort of untouched, pure raw filtered,unfiltered data. 

The other one is a staging view where you can kind of run experiments and try stuff out and transform your data a little bit,and even if you mess up it’s fine. Then the third one and the most important one where you’re kind of doing your day to day analysis in everyday is your main view. Let’s setup each one of those next. I’m in Google Analytics and got to make sure you’re on the right account and the right property. Going to go over to view, click this dropdown,and at the very bottom I’m going to click create a new view, a brand new view. It’ll be a website and this is going to be my unfiltered view. 

My unfiltered view, go ahead and click create. Cool, success, so we now have two of our views,we have our main view and our unfiltered view. Now we want to create our staging server view. If I jump into all website data, that’s the main view, click view settings, and I want to actually copy the main view completely,so go up to copy view, and this will be staging view. That is our staging view. We have all website views, staging view, and unfiltered view. 

One I just recently deleted that I’ll get removed in a little bit. I’m going to head back over to all website data, go to view settings, actually going to change that view name to my main view just to keep it clean. Go down here and hit save. There we are. If I refresh the page it should have my mainview, my staging view, and my unfiltered view ready to go. That is it, that’s how to add Google Analytics To your WordPress site using Google Tag Manager. 

I hope that was useful. If it was helpful and if you learned something today go ahead and click subscribe down below to get even more digital marketing tactics and tips from us at ClickMinded. If you’re watching this on YouTube I’d love to hear from you. What’d you think? Did you do it this way? Do you prefer to do it a different way? Do you think this was helpful? I’d love to hear from you. Go ahead and leave a comment down below rightnow. I read every single one. 

Finally, if you want this exact walkthrough as a downloadable, including links to all the resources we talked about today in an easy step by step guide, go ahead and click the link down below to to get everything we talked about today as a free downloadable. Thanks a lot.


Please enter your comment!
Please enter your name here