SEO Basics: Using Google Analytics With WordPress to Track Your Website Stats

Posted by – April 1, 2011

If you’re trying to increase your blog or website’s search-engine traffic, you need to do two things. Firstly, apply SEO techniques to draw visitors to your blog. Secondly, use a good traffic analysis program to see where your visitors are coming from and what they’re searching for.

Viewing detailed stats on your website visitors can really help you to target your articles correctly. You can also use a good stats program to judge how successful your various attempts at promotion have been. A good stats program lets you answer questions like:

  • How many visitors have come to my site through search engines?
  • How many visitors have bookmarked my site or memorized my URL?
  • What countries do my visitors come from?
  • What websites are referring visitors to my site?
  • What key phrases are my website visitors searching for in Google?
  • What browsers do my visitors use?

Google Analytics — The Free Solution

Since a good stats analysis program provides you with so much information, you might expect you’d have to pay top dollar for such a piece of software. Fortunately that’s not the case; Google Analytics is in fact free and provides you with a huge array of interesting stats for your website via an easy-to-use interface.

So how you do set up Google Analytics to work with your website? I’ll assume here that you’re using WordPress, the free blogging platform. However, don’t worry if you’re not using WordPress; I’ll also explain how to add Google Analytics to any website.

Getting Started With Google Analytics

The first thing to do is go to Google Analytics and create a free account, if you haven’t got one already. Once you’ve got an account, click the big “Access Analytics” button and you’ll see a screen rather like the following.

Google Analytics

Click to enlarge


You can see I’ve already got two websites set up in Analytics; one of them had 506 visitors in March, the other (a site I’ve just created), only 46 visitors.

Let’s go ahead and add another blog to Google Analytics. Click Add Website Profile and fill in the details on the new screen. Click Finish.

Google Analytics

Click to enlarge

We now see a screen that looks like the following:

Google Analytics

Click to enlarge

You can see some cryptic-looking computer code in a box underneath where it says Paste this code on your site.

If you’re not using WordPress, you need to copy this code with your mouse (select everything in the box, right-click and click “copy”). You need to paste this code into every page that you want to track, before the closing </head> tag in your page. Usually your website will have a header that’s copied into every page, so you’ll most often only need to edit one file.

However, if you are using WordPress, there’s an easy and elegant way of accomplishing the same thing. Look at the string of letters and numbers (beginning with UA) to the right of where it says Web Property ID. Copy this code. The code will be something like UA-87685123-4, for example. You can also find this code embedded somewhere in the stuff you see in the text box mentioned above.

Now log into WordPress, click Plugins and click the Add new button. In the search box that appears, enter “Google Analyticator” and click “search”. Google Analyticator is a WordPress plugin that simplifies the business of adding Google Analytics to your site.

Wordpress

Click to enlarge

Once you’ve found the Google Analyticator plugin, click Install now. Then click Activate plugin. WordPress will now return you to the list of plugins.

Wordpress

Click to enlarge

You’ll see that next to Google Analyticator is a settings link. Click this to go to the screen where you can connect your Analyticator plugin to your new Google Analytics account.

Wordpress

Click to enlarge

Here there is a text box where you can enter your Google Analytics UID; you need to paste in the UA-XXXXXXXX-XX code that you copied earlier.

Wordpress

Click to enlarge

Make sure Google Analytics logging is set to enabled. Also it’s a very good idea to make sure that Track all logged in WordPress users is set to “No” and set User roles to not track to at least Administrator. This helps to reduce spurious stats due to you visiting the site yourself.

Finally click save changes right at the bottom of the screen.

We’re almost done. Now we can go back to the Google Analytics page we were working on earlier. Click Save and finish. Typically you’ll see that your new site has been added, but there’s a nasty-looking yellow warning triangle under the Status column in the table of websites being tracked.

Google Analytics

Click to enlarge

No problem. Click edit by the profile of your newly-added website. On the screen that appears, click check status.

Google Analytics

Click to enlarge

Now, assuming everything’s working, Google Analytics will say “Analytics has been successfully installed and is gathering data”. All you have to do now is wait for people to visit your site …

Google Analytics

Click to enlarge

Some Tips and Tricks With Google Analytics

Google Analytics is really geared towards viewing your stats on a day-by-day basis, not hour-by-hour. So you can’t rely on the data it reports being up-to-date; you can only rely on data prior to today. In fact, it won’t report intraday data to you by default. Fortunately it’s easy to get this data, and most of the time it appears to be pretty up-to-date.

Go to your website report in Google Analytics (click View report) and bring up the calendar drop-down by clicking next to the date in the upper-right-hand corner. Click today’s date and click apply.

Google Analytics

Click to enlarge

Now you can see today’s stats (which will likely be zero if you’ve just set up your site in Analytics following these instructions).

Google Analytics

Click to enlarge

Another good idea is to further filter yourself out of your own website stats by setting up a filter. This will only work if your IP address remains the same every day; this depends upon your ISP. You can use the site below to check your IP address; keep an eye on it — if it’s always the same, you can use it to filter yourself out of your website stats.

Go to a site like What’s My IP and make a note of your IP address. It will be something like 192.123.4.12. In Google Analytics, click the logo in the upper-left-hand corner to go to the Analytics home page. At the bottom of this page, click Filter Manager.

Google Analytics

Click to enlarge

Click Add Filter.

Google Analytics

Click to enlarge

In the screen that appears, select Exclude, traffic from the IP addresses, that are equal to. Enter your IP address in the IP address text boxes. Under Apply filter to website profile, select your new website and click add. Now click save changes and we’re done!

Google Analytics

Click to enlarge

Using Google Analytics

Once you start using Google Analytics, you’re liable to get addicted to it. This is especially true if you’re carrying out an SEO campaign to increase your traffic, regularly writing articles around key search phrases. You’ll want to select today’s date as above, so you can see the new visitors coming in to your site.

When you go to your site report in Google Analytics, you’ll see a page like this (once you’ve got some traffic!).

Google Analytics

Click to enlarge

In the menu on the top left, you can see various useful links. Click visitors to see who’s been visiting your site. Keep an eye on the date — by default it displays a whole month of data not including today, so you need to follow the steps above if you want to see today’s stats or a different time period.

Google Analytics

Click to enlarge

You can see all kinds of interesting stats about your visitors by clicking on the links that appear in the menu when you go to the visitors page. For instance, map overlay shows you a map of where your visitors come from. You can even find out what towns your visitors are from. Scary!

Google Analytics

Click to enlarge

Clicking Traffic source will show you how your visitors find your site, including what phrases they are searching for in Google.

Google Analytics

Click to enlarge

Basically you can have hours of fun and figure out how to bump up your stats in the process. Enjoy!

A Note On “Bounce Rate” and “Time On Site”

There’s one thing I must mention here, since it confused the hell out of me when I first started using Google Analytics and it probably means you will underestimate the level of interest among your visitors if you don’t know about it.

Google Analytics has a statistic called “Time On Site” in the visitors section. However, the only way Analytics can know how long a visitor spent on a page is if that visitor clicks another page afterwards. Google Analytics can only measure the time between successive clicks. This could lead to you overestimating how long a visitor has spent on a page, since the visitor might load a page from your site, go away and do some shopping, come back to his browser and then click another link, leading to a massive overestimate for the amount of time he spent reading your page.

More common however, is the situation where a visitor loads a page, then closes the page without looking at any other pages on your site. How often do you search for something, click on a page, read it and then close the page when you’ve finished? For me I’d say this is what I do most of the time on the Internet. This is called a “bounce”; you’ve “bounced” off the site instead of delving into it. Google Analytics records this behavior as a “bounce”, with zero time spent on the site — even though the visitor may well have read your page thoroughly and possibly even have bookmarked it or emailed it to his friends.

So if you see a high bounce rate in your site statistics coupled with a low average time spent on your site, don’t be too disheartened, since this statistic has to be taken with a pinch of salt.

Technorati Tags: , , , ,

1 Comment on SEO Basics: Using Google Analytics With WordPress to Track Your Website Stats

  1. amit says:

    I think,Google analytic is best tool to track websites stats.However there are lot of tools are available but we can not trust of all of them.So lot of people ask so many times as which tool they should use to track or analysis website stats,I ll recommend Google analytic tool as well.
    Thanks!

Leave a comment

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>

Notify me of followup comments via e-mail. You can also subscribe without commenting.