How to Install Google Analytics into a WordPress Website

This video tutorial covers two methods of installing and the Google Analytics (GA) tracking code into your WordPress Website for easy monitoring of traffic to your blog or business site. Google Analytics, is one of many options out there for tracking and analyzing Web traffic trends on your Website. However Google Analytics is an industry standard, is widely used and best of all it is free.

What the Video Covers:

  • How to integrate the GA tracking code into theme options (when available)
  • How to integrate the GA tracking code using a plugin

What You Need

Video Transcript

Hi, there. I’m going to talk about how to add the Google Analytics tracking code to your website. Now, there are many options out there in regards to how you’re going to track the amount of traffic you get to your website. However, Google Analytics is free. It’s the most popular. And it’s basically the industry standard to analyzing traffic patterns across your website.

So, I’m going to assume that you’ve already created a Google Analytics account. If you haven’t, simply go to and sign up using your Google account or create one. It’s free and very easy to get set up.

There are a few different ways that we can integrate the Google Analytics tracking code into a WordPress website. However, before I go into that, let’s first go over exactly what I mean by “Google Analytics tracking code.” If you’re logged in to the Google Analytics system and you click on the Admin tab, you’re going to get a screen that looks like this. Under the Property column, we’re going to have an option called Tracking Info. Clicking that is going to produce a few options and we’re going to select Tracking Code.

Now, the tracking ID is unique to our particular website. And so, if we’re looking for the tracking ID, that’s available right here. As well as the tracking code, which is available in this box below. So, now that we know what we’re talking about when I say Tracking Code, let’s go back to our website.

Now, like I said, there are a couple different ways to integrate this. The first is through the theme. Now, not every theme out there allows you to pace your tracking code directly into an options box in the WordPress admin area. So, you’ll have to check.

Check for an option called Theme options. Now, this may be located in Appearance. Sometimes, it’s under Settings or sometimes, it even has its own menu option. Now, this particular theme that I’m using here for demo purposes just happens to have an option under Other. Now, again, you’re going to have to click around or check the documentation under exactly where you can find yours.

And if you check this out, “Code to display on header” and “Code to display on footer.” Now, I’ve already pasted my Google Analytics code into here. And that’s it. Upon saving this, my theme is going to take care of inserting this code on every page that is viewed on my website. And as a result, Google Analytics is going to track that traffic.

Now, the next method is through a plugin. Now, I’ve already installed the plugin and there are many out there. But Google Analytics is all you have to search for and you’ll find several out there that allow you to simply integrate Google Analytics into your WordPress website. Now, you’re going to want to use a plugin if your theme doesn’t have the option that I just showed you.

In this particular case, the Google Analytics plugin can be accessed under Settings. And it’s super simple. Basically, it’s going to ask for our property ID. Now, last time, we grabbed this and we copied this into our theme options. This time, we’re simply being asked for our tracking ID, which is this number right here.

Upon saving changes, that plugin is going to ensure that our Google Analytics code is available on all the pages within our website. Again, tracking the traffic across our site. Now, you’ll noticed that I just added it to my theme options and I used the plugin. Now, this is just for demo’s sake. You’re only going to want to use one or the other. The other thing is, you don’t want to bog down your WordPress website using a lot of plugins. So, definitely look to see if your theme has the option. If it does, use that.

Now, the final method is to actually alter the WordPress files. Now, I’m not going to over that, because we try and stay away from code and editing code within these video tutortorials. So, that’s basically how you’ll get the analytics code into your website.