Adding Google Analytics To A WordPress Blog

When setting up a WordPress blog, it’s essential that you find a way to monitor the traffic coming to your site. If you know where the visitors are coming from, then you can manage your traffic startegies better.
One of the best traffic analytics systems around is Google Analytics. It’s free, and is very easy to use. Here’s a step-by-step guide to installing and using it.

Before starting, make sure that you are logged in to a gmail account, or one linked to Google. If you don’t have a gmail account I would strongly suggest you sign up for one, or at least link one of your existing email accounts to google.

Open your browser of choice and go to Google Analytics sign up page and click on “Sign Up”
As long as you are logged in to a Google account, this should sign you up immediately.
On the next page you start to add the website details of the site(s) you want to track.
Fill in all the details of your site, then scroll to the bottom and click on “Get Tracking ID”
Straight Talk For Success

On the next page you will find your tracking code. Now don’t be afraid of this page, it may look complicated, but we only need a bit of the information on it. You will need to scroll down and copy all of the tracking code

copy analytics code

Make sure that you leave the analytics window open, as we’re going to be going back to it later.

So, now you have your tracking code, but what do you do with it next?
Now we have to add the code into your wordpress blog. There are many ways to do this, but the easiest way I have found is using a plugin. One I have found that is easy to use is Insert Header and Footer. This will put the code in exactly the right place for you, so you don’t have to mess around editing any code.
To install the plugin, go to “Plugins” – “Add new”, type in the name of the plugin, in this case “insert header and footer” and press enter. it should come up either first or second on the next page. Click on “Install Now”, and on the next page, click on “Activate Plugin”
actvate plugin

With the plugin now activated, you can access it by going to “Settings”, “Insert header and Footer”

insert header and footer

Now you need to go back to the analytics page. I told you we would be going back, didn’t I? 😉
Highlight all of the code in the box and copy it.

Go back to your blog, paste the code in the “Scripts in Header” box, and then click “save”

paste analytics code

And that’s it, you now have Google Analytics tracking every visitor to your site!

Be sure to leave it for 12-24 hours before looking at your analytics, as it can take that long for data to be collected and displayed.

In my next tutorial I will be showing you How To Add More Websites To Your Google Analytics


  • Irena

    Reply Reply July 20, 2015

    Great article, Keith. Where were you a few months ago when I needed it? I recommend everybody on the internet to read it.

  • Marcel K. Bender

    Reply Reply July 20, 2015

    Hi Keith

    A very good Tutorial and easy to understand. I like to see more of that. Thank you very much.
    Marcel K. Bender recently posted…WEEK 2 QSCMy Profile

  • Hi Keith,

    really good content. That information every new blogger needs:-)

  • Kevin Everett

    Reply Reply July 21, 2015

    Hi Keith. I used that plug-in as well but for mine to work I had to paste it into the footer for some reason. Maybe it is the theme I am using. Anyway, if anyone is having the same issue putting it in the header section of the plug-in, try putting it in the footer section instead and see if it works.
    Kevin Everett recently posted…Effortlessly Build Your Email ListMy Profile

    • keithr13

      Reply Reply July 21, 2015

      Yeah, occasionally a theme doesn’t use the header on every page, so putting it in the footer fixes that 🙂

  • Nicolas

    Reply Reply July 22, 2015

    Hello Keith,
    wow!! that was perfect timing!! I was just looking around and searching this particular plugin for my blog and I saw a lot of technical stuff there and there….So I just didn’t complete it..

    Until I saw your post about how to install it and you made my day!!

    Thanks for the tips, it was really relevant.

    All the best 🙂
    Nicolas recently posted…Week 2 challenge, done!!!My Profile

  • Harold

    Reply Reply July 22, 2015

    Hi Keith,

    It helps my man now will look for your other instructions on this google analytics.

    Thanks again!

    Harold recently posted…Quick Start Challenge Week 2My Profile

  • Sanna Väätänen

    Reply Reply July 22, 2015

    Hi Keith! Thanks for this tutorial! I mostly use themes that have header and footer boxes by default, but it’s good to know about this plugin for themes that don’t have that functionality already. As a programmer and web developer I know how to add code to the header, but it’s so much more convenient if you don’t have to go edit the code files, and there’s no need to worry if some code changes disappear with WordPress updates and so on.
    Sanna Väätänen recently posted…Next year this time – The Quick Start ChallengeMy Profile

Leave A Response

* Denotes Required Field

CommentLuv badge