How to Install Google Analytics

Once your blog is set up, it’s helpful to track your visitors to see who’s visiting, from where they are visiting, how many are visiting, how long are they staying, which pages they are visiting, etc.

This information (called your “stats”) is highly valuable and will help you maximize your blogging efforts. Not only will it provide you the opportunity to better connect with your visitors, this is information advertisers and potential advertisers will definitely want to know.

There are several stat tracking options but the most popular is Google Analytics. I personally use it (in addition to Stat Counter).

To use Google Analytics, you must have a Google Account first

To be able to track your stats with Google Analytics you first need a Google Account. A Google Account gives you access to all of Google’s products like Gmail, Calendar, Google Reader, Google+,  etc. So, if you don’t already have a Google Account, get one here. The process is pretty straightforward.

How to Get Started with Google Analytics

Once you’ve got your Google Account, go to Google Analytics account and click the “Sign in” link in the top right.

google analytics sign in

If you’re not logged in with your Google Account, you will be prompted to do so. Once you’re logged in, you’ll see a screen like this:

Google Analytics sign up

Click the “Sign up” button. (I know. A lot of signing up and accounts.)

On the next screen, you’ll do two things. First, you will set up your “web property” (i.e. your blog/website). Second, you will set up (yet another) account. (I know. It’s crazy. Just a tad bit confusing, but stay with me…) Here’s what it looks like:

Google Analytics add property

Make sure the “Web Site” tab at the top of the screen is selected (unless of course you are adding an app but if you’re reading this, that’s highly unlikely).

Next, under “Setting up your web property” enter the appropriate information. Pretty straightforward.

Then, under “Setting up your account” you will enter an Account Name. Now, this account is basically a way of organizing all the sites you will track within Analytics. For some people with a ton of sites to track, this is helpful, but for us, it would be sufficient to use your name, your blog name or whatever you like.

(I leave the Data Sharing Settings checked typically, but it does give Google access to your info so you might want to click the little question mark next to “Data Sharing Settings” for more info.)

Click the blue “Get Tracking ID” button.

You’ll need to accept the Google Analytics Terms of Service and then you should see this:

Google Analytics Tracking

Note the “Tracking Info” tab is selected. (You can access this tab at any time by logging into your Analytics account –> Admin tab in right corner –> Account List –> selecting the Account name you chose in the last step –> selecting the name of the web property from the list –> clicking on the “Tracking Info” tab.)

Also note, “Status: Tracking Not Installed.” That’s because we now have to take that snippet of code in the box there and paste it into our site. Once it is installed correctly, that status will change to “Status: Receiving Data.”

How to install the tracking code in your site

First, select the entire snippet of tracking code. We want to paste this code just before the closing < /head > tag.

This is where using Genesis or Elegant Themes is super nice because they make it easy (although it’s not too hard in Twenty Eleven or Twenty Twelve either).

Login to your WordPress Dashboard.

Installing tracking code in Genesis

From your Dashboard, go to Genesis (in left column) –> Theme Settings.

Scroll down until you see the “Header and Footer Scripts” box like so:

analytics tracking code

Paste your tracking code into this box. (If you already have code in here, paste the Analytics code at the bottom.)

Don’t forget to save!

Installing tracking code in Elegant Themes

From your Dashboard, go to Appearance (in left column) –> [Theme Name] Theme Options.

In your epanel, click “Integration” –> Enable Header Code. Paste the code in the “Add code to the < head > of your blog” box at the end, per Google’s instructions.

Elegant Themes tracking

Don’t forget to save!

Installing tracking code in Twenty Eleven or Twenty Twelve

(I recommend you back up your blog before you do this as you will be working in the sensitive files of your site.)

From your Dashboard, go to Appearance (in left colum) –> Editor.

In the right column, click on “Header” under “Templates.” This is your header.php file.

In the main window, you’ll see a whole bunch of code. Being very, very careful not to erase anything or otherwise edit anything, find the < / head > tag (no spaces). Place your cursor immediately in front of it and press enter to create an open line immediately before the  closing < / head > tag.

On the blank line, paste your Analytics code.

twenty eleven analytics code

Don’t forget to save by clicking the “Update File” button.

How to make sure your Google Analytics tracking code is installed properly

Log back into your Analytics account.

Click the “Admin” tab in right corner.

Select the appropriate account.

Select your web property.

Click the “Tracking Info” tab at the top of the list (see image above).

If you see “Status: Receiving Data” you’re good. If you see “Status: Tracking Not Installed” or something similar here are a few things you can do:

  • Wait a minute or two. It shouldn’t take longer than a few minutes to start tracking, so if you still don’t see that it’s tracking after a few minutes, do some more troubleshooting.
  • Complete the process again making sure you are copying and pasting the entire snippet of code. Make sure you save after pasting!
  • If those don’t work, log out of Analytics and log back in. You never know if that’ll do the trick…
  • Check the Google Analytics Help section and these common issues.

How to install Google Analytics with a plugin

I much prefer the above steps to install Google Analytics as I’m not a fan of unnecessary plugins, but if you’re desperate, you might consider a plugin. Use my instructions in How to Install a Plugin for more.

How to view your stats

Data updates every 24 hours so you will have to wait that long to see your most recent stats.

  1. Login to Google Analytics.
  2. From your Account Home, click the account under which your your web property (website) is contained.
  3. Click on your website name when it drops down.
  4. Your Account Overview will appear. Navigate the menu on the left to pull out more specific bits of information. For example, your Overview will give you an idea of your basic traffic levels. Your Traffic Sources will tell you where traffic is coming from, etc.

(The interface changes frequently, but if you want to see a relatively new overview of Google Analytics, try A Beginner’s Guide to Google Analytics 5 at the KISSmetrics blog.)

In addition to tracking your stats, I’ve also explained 7 Ways to Optimize Your Exit Pages which is a good idea.

Don’t forget to reference the How to Start a Blog or Website Cheat Sheet to work through the series at your own pace.

Do you get The Useletter™?


  1. says

    Was glad to find this site again – the instructions for finding the google analytics code again was what I needed! I remember putting this into 2012 before, but I apparently forgot about it when WordPress updated. I wanted to let you know I found out about a cool plug in called Insert headers and footers by iamdbpegg I put the info in there (and I think I had to empty the page cache because I have W3 total Cache installed.) Then I didn’t have to go into the code. I *think* that might also mean that the change won’t disappear with a WordPress update.

    (P.S. For me, the images in this post appear to have broken links.)

  2. says

    Thanks your tips,
    I did it step by step for my Metro Pro theme , but it don’t work. The status of Google Analytics always the code not installed. Please help me fix it.

  3. says

    Hi Amy,
    I have a question and I have searched (and searched) for this answer. I wish I could ask analytics directly, but can’t find an email. I just started my blog not too long ago and have installed analytics almost from the beginning. Seemed to work great. However, when I get to a certain number of total pageviews, I cheer because it is a good number. Few days later, it says I have 100 less. So I build back up to that number. Cheer again. Then a few days later, it says I have around 100 less. Today I checked, it says I have 3 less than yesterday, however the daily stats says I grew considerably.
    Any ideas at all?

  4. wendy says

    Hi, i have the themeforest theme and actually they provide insert tracking code column but when i checked on my google analytics, the status is “tracking installed’ but i dont have any visitor in my report even i tried to visit my own website,
    In other hand, my other website got “Receiving Data” statuus and it has visitor report,
    What is different between receiving data and tracking installed ?

  5. says

    Thanks for the great post Amy – it helped me install Google tracking on the Woothemes Canvas theme. If anyone else needs to know, go to Canvas Theme Options->General Settings->Quick Start and enter the tracking code in the “Tracking Code” box.



  6. says

    The cool thing now is that, you can see if you’ve installed it correctly by visting the website you installed it on and then going to Google Analytics and clicking “Real Time”. If you see yourself on, you’re gold!

  7. says

    Hi Amy,

    I have the google analytics code already pasted over the tag on my wordpress blog. But I read how Yoast’s google analytics plugin provides custom variables. Can these variables be added without any plugin?

    Thanks for this great post!

  8. says

    Hi Amy,
    Before doing a search for ‘genesis framework how to install google analytics code’ I never knew your site existed! Thank you so much for the detailed explanation and overview – it’s a rarity for me to find what I’m looking for on the first click after doing a search. What a great way to end a hard day’s work. Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>