Google Analytics is one of the more powerful tools available for bloggers to help you learn about your site traffic statistics, how people are finding your site on the internet, what posts they are reading, how many posts they read, how long they spend on your site, and a whole host of other factors.
In this post, we will learn how to set up Google Analytics for your site.
Create a Google Analytics Account
The first thing to do is create a Google Analytics account. You should already have a Google account set up from when we set up our Google Webmaster tools. If you haven’t set that up yet, go do it now. Later, if you want to monetize your blog, you will need a Google account to get into Google Adsense. Get used to it now: Google is a blogger’s best friend.
You begin by logging in at Google Analytics.
After you login, you will be given a little welcome screen, and invited to Sign Up for Analytics.
When you click “Sign Up” Google will ask you for the domain you want to register, and the Profile name. It automatically sets your website as your profile name, which works fine for me. But if you want to change it to something else, you can. Set your time zone, and click “Continue.”
In the next couple of screens you need to enter your Contact Information and agree to the User Agreement. I won’t include screenshots for that, because they are self-explanatory.
Add Google Analytics Tracking Code
Eventually, you will arrive at the Analytics Tracking code screen, which looks something like this:
Note the part underlined in red. This is the unique analytics code for this particular website. Each website has its own unique code. You need to add this code to your website, and there are several ways of doing this. I survey three methods below.
Make sure you only choose one of the options, since if you install this code more than one time on your blog, it messes up some of the analytics statistics. Here are the three ways, organized from hardest to easiest:
- Install it into your header.php file of your blog.
- Install it using the Google Analytics Plugin.
- Install it using a WordPress Theme like Standard Theme which has a Google Analytics section built right in.
Since I use Standard Theme, that is my preferred route, but I will walk you through all three just in case you want to use one of the other methods.
Add Page Load Time to Google Analytics
Before we install the code to our blog, let’s add one line. Along with everything else Google Analytics tracks, I also like Google to track how fast my pages load, as this is an important factor for page ranking and website visibility.
So we are going to add this line to our code:
Where does it go? Right after the other _gaq.push items in the code. Click over into the “Custom” tab, and add that line of code after the other two. It will look like this:
Now that this is done, let’s get it into our blog.
Starting with method #1.
1. Add Google Analytics Code to header.php
First, highlight all the code from Google Analytics and copy it.
Then go over into your blog Dashboard, click on “Appearance” and select “Editor.” From the list of files on the far right, find the one called “header.php” and open it up.
Scroll down in the file until you find the closing </head> tag, and paste the Google Analytics Code into the file right BEFORE that closing tag. Save the file, and return to Google Analytics to see if you installed it correctly.
See? That wasn’t so hard. But the next two methods are even easier!
Remember, only use one method! If you used method 1 and are happy with it, skip past the next two methods.
2. Use Google Analytics Plugin
Search for the “Google Analytics for WordPress” plugin and then install and activate it.
You will be greeted by this warning:
Click the link, and you will be taken to a screen where you are asked to enter your Analytics Profile. Remember that unique analytics website code from earlier? This where you put it.
You can have it log in to your Google Analytics account and pull the code from there, or you can click the “Enter the UA code manually” checkbox, and enter the code yourself. That is the option I chose.
I also clicked “Advanced Settings” just to see what they were, but I was fairly happy with the preset options, and so left them all as they were. If you want to change any of those feel free.
As with the previous code installation option, you should now return to Google Analytics to make sure the code is tracking properly.
Let’s move on now to the best and easiest way of installing the Google Analytics code on your website.
3. Let your Theme Install the Code for you
This method really only works if you have a good WordPress Theme like I do.
Standard Theme is so good, it comes with an Analytics section built right in.
When I go into the RSS and Analytics Screen, all I do is paste the code into the ready-made Google Analytics section, click “Save Settings” above, and I am off and running.
Just another reason I love the Standard Theme.
Check to See if Analytics Code is Entered
Now that we have installed the Google Analytics code using one (and only one!) of the methods described above, let us return to the Google Analytics page to make sure everything is operating smoothly.
When you click “Save and Finish” at the bottom of your screen, you will be taken to a page that looks like this:
As I indicate in the image, if it doesn’t say “Waiting for Data” then click the “Check Status” button, and it will update. By the way, if you ever need to get your tracking code again, clicking the “Check Status” button will take you to the tracking code page.
Now, all you have to do is wait, and eventually the tracking code will get everything it needs, and start tracking your website data. When you start getting data, it will look something like this:
Hopefully, your stats go higher and higher with every month you blog. If you follow some of the tips and advice here on Grace Blogger, that is exactly what they should do!
In a later post, we will look at the strength and power of Google Analytics in more detail. For right now, let’s push forward with getting our blog up and running so we can start writing quality blog content.