In this week’s blogging tutorial, I’m going to show you how you can start to monitor your blog’s statistics using the very popular StatCounter service!

First, why do you need to monitor your blog traffic statistics?

If you are blogging for fun, it might not be necessary for you to monitor your stats – after all, you don’t care who is visiting your page, and how they end up here. However, even if you just want to learn how to push your blog up the publicity scale, monitoring your stats can one one of the first things you need to do.

The primary reasons for monitoring your blog statistics are as such:

  1. So that you can track your traffic is increasing, and by how much
  2. So that you can track where your traffic is coming from

So, for example, if you find that after regularly posting on a particular forum, you find that more people are coming to your site through the pages in that forum, then you know that your marketing strategy has been effective. Simple?

Let’s get started now!

The process of adding StatCounter involves only three simple steps.

  1. Create a StatCounter account and project
  2. Configure code to add to your blog template
  3. Add it to your blog template!

Step 1: Create a StatCounter account and project

Head on to StatCounter.com. Here is what you see.

statcounter.gif

What you need to do first, is to go ahead and register an account. The account (limited log size) is free, and you can choose to upgrade later.

So go ahead and click on register on the top left. You will be prompted for a username, password and some other details. Key them in and click on “register my account”.

Very immediately, your account is created and the next step is to create a StatCounter project.

Every account allows you to host multiple projects. Look at a project in terms of “one monitoring code”. It does not mean that one website can only have one monitoring code. For example, if you have a website with both a forum and a blog, you might want to create different projects for each section of your website.

So go ahead, create a project. The project that you create should be a “Standard Statcounter Project” and for that, you will need to specify a few parameters like your website title (which is in this case your blog title), your website URL and the category.

standard-statcounter-project.gif
project-options.gif

There is also an option for you to specify if you want your stats to be available to the public.

You are done with Step 1!

Step 2: Configure code to add to your blog template

After the project has been created, you will be prompted to configure and install code for the project. Go ahead and click on it.

project-created.gif

Follow the easy wizard interface – most of the options are either pretty simple to understand, or if not, you can just leave it at its defaults. In this process, you can choose if you want to display a counter, or use an invisible counter.

In the second last page of the wizard, you will be prompted if you use a particular web page editor. Select “No, I want the default install guide”.

default-install-guide.gif

At the end of the whole wizard, you will get a piece of code that looks something like this:

code.gif

Click into the text box (this will select all the code) and then press Ctrl-C to copy the code into your clipboard.

You are done with step 2!

Step 3: Add it to your blog template!

The last part of the process is to add this code to your blog template. This part can be quite tricky if you are using WordPress, because of the multiple files you have in the template.

You need to add this code to the pages that you want to monitor. So, for example, you want to monitor your single pages (i.e. permalink pages), then, you will have to add it to your single.php. If you want to only track the stats of your main page, then you will have to add it to index.php.

However, a much better way if you want to track the stats to any visitors to any part of your blog is to add this code only once, to a page which will be loaded every time you view the blog, regardless of which page it is at.

For example, if you have a footer.php, it could be a potential place for you to add the code into. For myself, I like to keep my extra codes in the sidebar, which is sidebar.php.

To add the code, simply fire up the page you want to add the code to in notepad and select a convenient location, and then press Ctrl-V. From a programmer’s standpoint, it would be good to put this together with all other scripts that you have added to your site, and away from the main display elements of your site (unless you are showing a counter).

Note that wherever you add your code, it has to be within the HTML body tag (especially when adding to footers).

Save the template after adding the code and upload that file up to your server to replace the existing template, and you are done! To access your stats once the code is on your site, log in to StatCounter, go to “My Projects” and click on the relevant project!

So in 3 simple steps today, you can start to monitor your blog statistics! :mrgreen: