Adding a StatCounter visit count to your WordPress blogroll

By Grant Jacobs 07/05/2013 1


Here’s how to install a StatCounter visit counter into WordPress blogrolls. Or at least sciblogs blogrolls! – this is mostly for my blogging colleagues, but I hope those with other blogs should be able to follow along. In future posts I’ll describe adding a Sitemeter visit counter or a ClustrMap, which tracks where in the world those who visit your blog are from.

It’s fun to see how your blog is going, to keep tabs on if it’s suddenly getting a lot of visitors and where your visitors are from. The three main tools for tracking visitor statistics (more than just how many visit) are Sitemeter, StatCounter and Google Analytics.*

I recommend people use StatCounter over Sitemeter, owing to the latter’s erratic failures over the past year or so. (An on-going issue that seems to be, well, on-going.)

My description is particularly for where the bloggers don’t have access to the backend to install plugins, like sciblogs.

1. Sign up and start your tracking project

StatCounter offers a page-by-page, step-by-step process. It’s friendly, but has more steps.

Go to statcounter.com and click on ‘Sign up’ from their tabs, then enter the details. (You might like to use the name of your blog as the username. It‘s not a bad idea to get a gmail account dedicated to your blog.)

statcounter-1

After clicking ‘Create Account’ on the bottom-right you’ll be presented with a page asking you to set up your first project:

statcounter-2

(Sciblogs bloggers will want to use the full URL to their blog, e.g. http:sciblogs.co.nz/code-for-life/ for Code for life.)

When you enter the URL for your blog, you’ll see that StatCounter offers a title for the project, filling in that part of the form for you.

(Continuing down the left column of options, if New Zealand bloggers want to be added to Ken Perrott’s NZ blog rankings, you’ll want to check ‘Make Statistics Public’. You can leave the link to display alone as we’re going to set one up.)

If you’ve already been blogging for a while and are shifting from another visit counter, click on ‘Customize!’ immediately under the ‘Visible Counter’ option to the right. A pop-up will appear: if you click click on ‘Starting Count’ under the menu in the pop-up you can set how many visits you’ve already had. (No cheating!)

I suggest weekly emailed reports (the default).

statcounter-visible-count-option

You can either have the live counter in your blogroll and everyone will see how many visitors you’ve had right from your blog.

That’s the default setting – ‘Visible Counter’, to the right of the options.

statcounter-button-option

You can also choose one of several images, what I’ve done for Code for life. To do that, check ‘StatCounter Button’, then select which image you like.

While you can have no image show, I suggest you display something or you’ll end up with an odd-looking gap in your blogroll.

Click ‘Add Project’ at the bottom-right.

2. Getting the web address to add to your blogroll

(I’m going to speed up a little here: if you want more screen shots, let me know.)

You should now be viewing a page titled ‘Choose an Installation Guide for your Website’: click on WordPress from the long list of guides.

You’ll now be asked which WordPress! We want WordPress.org, the second option: click on ‘Go to the open source WordPress.org installation guide’.

You’ll now be shown a page telling you how to enter their default code snippet. As we’re trying to install into the blogroll we get to do it a bit differently to these instructions.

Instead click on the link ‘install the plugin manually’ near the top of the page.

On this page you’ll see a complicated bit of code under the heading ‘Standard’. Click on the tab ‘Basic’. You should see something like this:

statcounter-code

This is the web address we want to install into our blogroll. You’ll find that it’ll try select all of the code – copy all of it into a word processor or text editor and copy the piece we need. Select and copy the web address inside the src=”http://c.statcounter.com/8928698/0/4ee56701/0/” part, as I’ve boxed below. Leave the StatCounter page open in a browser tab – we’ll be coming back to it.

statcounter-code-boxed

3. Installing the web address into your blogroll

Login to your WordPress Dashboard, and select ‘Links’ from the left column. Click ‘Add new’ near the top of the page. You should see a form to enter, with a series of entries (don’t forget the last one):

  • Name – this is the name that shows on the Dashboard presentation of what links you have added, not what is shown on the page. I use ‘Stat Counter’.
  • Web Address – here you want to enter the web address we copied from the StatCounter code.
  • Description – I just use the same as for the Name field: ‘Stat Counter’, but you could write, say, ‘Hey! I’m really popular’ or whatever… 🙂 Users of your blog will see this if they roll their mouse over the StatCounter link.
  • Categories – leave this set to ‘Blogroll’.
  • Target – leave this set as _none. (Altering this takes control of what tab or page the link opens in, which is bad practice in my opinion – users can easily ask for it to be in another tab themselves if that’s what they want.)
  • Link Relationship – I guess I can leave that up to your imagination…
  • AdvancedThis one is important. It must contain the web address we copied from the Stat Counter code.

statcounter-blogroll-eg

Click ‘Add link’ (blue button to the right-top of the page) and check your blog. You ought to now have a link to StatCounter.

4. Finishing off with StatCounter

Go back to the StatCounter tab.

You should be on the ‘Default Guide’ page with the code snippet under ‘Basic’ that you copied. Go back one page from to the ‘Insert Code Snippet’ page. (Use the browser’s back button.)

Try clicking on the ‘Check Installation’ button on the right toward the bottom of the page. StatCounter will visit your blog and try work out if the StatCounter link has been set up OK.

You’ll probably get a message saying that you’ve only got a basic setup. That’s OK. That’s what we get for installing just the web address into the blogroll rather than the full plugin.

Once that’s done, you’ll get to go to your projects page.

I’ll leave you to the rest – it ought to easy enough to follow. Click on the project link, to the right of the little graph icons and you can tinker with your settings and explore the different statistics. (You’ll note some you can’t get, too.) Feel free to ask in the comments if you get stuck.

Footnotes

* I’m not going to cover Google Analytics, which works differently. For those that do look at this, countries may have country-specific Google Analytics sites, e.g. google.co.nz/analytics/.


Other tips on Code for life:

Reading winmail.dat files sent to Apple Mac users

Mac OS X — quickly inspecting the contents of a file

LyX for free word-processing

Skim – free PDF viewer and annotator for Mac OS

WWW database servers on Mac OS X 10.6.x, part I: Installing MySQL


One Response to “Adding a StatCounter visit count to your WordPress blogroll”

  • For those wanting to have their blogs added to Ken’s tally of New Zealand blogs, in addition to making it publicly accessible, Ken will need the web address (URL) for guest access to your StatCounter project.

    It’ll be of the form:

    http://statcounter.com/8926898/?guest=1

    You’ll see the number in this web address is the first of the two big numbers in the web address I had you add to your blogroll.

    You can put this web address into the Web Address field of the blogroll entry for StatCounter. If you do this, if users click on the StatCounter logo or counter (depending on what you chose) your StatCounter statistics page will open and they can explore the statistics for your blog. It’ll also mean that Ken can find your StatCounter page from your blog without you having to give it to him.

    [I’ll update the article in later to reflect this.]