Official WordPress Plugin for StatCounter

For all you wordpress.org users out there, we’re delighted to announce the release of our official WordPress Plug-In – this will allow you to easily install StatCounter on your wordpress.org blog and enjoy the full range of StatCounter stats!

We’ve also updated the install guide for wordpress.com to make it easier for you to add a html-only counter to your wordpress.com blog.

Wordpress

How do I use the StatCounter wordpress.org plug-in?

  • Log into your StatCounter account.
  • Click the wrench icon beside your project name.
  • Click the ‘install’ code link.
  • Follow the wizard and when asked for your web editor choose “wordpress.org”.
  • Follow the remaining instructions and hey presto!

How do I add StatCounter to my wordpress.com blog?

  • Log into your StatCounter account.
  • Click the wrench icon beside your project name.
  • Click the ‘install’ code link.
  • Follow the wizard and when asked for your web editor choose “wordpress.com”
  • Follow the remaining instructions and Bob’s your uncle!

What’s wordpress.org?
Wordpress.org is the version of wordpress that YOU host on your own server. This means you have full access to modify the blog template as you wish i.e. you can add the full StatCounter javascript code.

What’s wordpress.com?
Wordpress.com is the version of wordpress that WORDPRESS hosts on its servers. This means that access to modify the blog template is restricted according to what wordpress allows i.e. you can only install the StatCounter html-only code.

What’s a html-only counter?
Where you can’t install a full javascript counter, StatCounter offers you the option to install a html-only counter. While a html-only counter can’t offer you the same range of stats as the full code can, it does provide you with information on hits, browsers, location of visitors. You need to install the full javascript code to see referrers – the html counter can’t capture this information.

Why won’t wordpress allow javascript code?
For security reasons wordpress don’t allow you to install javascript code on blogs hosted by them i.e. wordpress.com blogs. We’re sure though that, if enough of you request the full StatCounter code on your wordpress.com blogs, then Matt & Co would be happy to oblige! We would certainly be happy to work with wordpress on this. So get emailing and don’t forget to pop back here to let us know how you get on!

PS: Thanks to Luke Stevenson for developing the first StatCounter plug-in for wordpress!

Update: Any problems installing the plugin? Let us know!
A few members had trouble installing the plugin. We believe this may have been a problem with the difference between return characters in windows and unix. If you try to download and install the plugin again it should work now. If it is still not working for you we would love to investigate the problem for you. Please send us the login details of your blog and server and a report of the problem you are experiencing.

186 Comments

  1. Thanks for this, guys!

    One suggestion: would be great if you could exclude logged in users of a certain level from tracking, as you can with the Ultimate Google Analytics plugin.

  2. Good job guys, I installed the latest version and it’s all working fine. This is great stuff, thanks for developing the plugin!

  3. Hi Rico,

    The plug-in file was using the UTF-8 character set – this added an extra piece of text to the top of the file which was creating problems for some WordPress users. We have now switched the character set and the plug-in should now be working fine for everyone. Let us know how you are getting on!

    Thanks so much for your help resolving this issue.

  4. rc, try using vi or vim editor in binary mode to edit the StatCounter-Wordpress-Plugin.php file and remove the garbage characters at the beginning of the file. Don’t use notepad or other gui text editors. It worked for me.

    just type in the command prompt: vim -b StatCounter-Wordpress-Plugin.php

    and you’ll be able to see the garbage characters and remove them.

    To statcounter guys, what editor did you use that caused the garbage characters to be prepended to the PHP file?

  5. Hi RC,

    Can you send us your login details to your server so we can debug and fix this for you.

    http://www.statcounter.com/contactus.html

    thanks!

    StatCounter Team

  6. FYI, I just installed the “new” version (1/17 10am PST), and I’m still getting the “” string. I uploaded using ASCII mode.

  7. Oops I just realized I can simply edit the PHP plugin file to make it use text instead of a graphical counter, sorry.

  8. Hi guys, it turns out that David above was right about the “” string appearing before the <?php at the top. I wasn’t able to see it at first because I used notepad to open the PHP file but then when I used vi in binary mode the culprit was there. I removed the 3 characters and the problem was fixed!

    I have one small gripe thought, I specifically chose to use text instead of a graphical counter. This appears correctly in the home page of the blog but in sub pages the graphical counter was used.

  9. Hi Rico,

    Can you send us your login details to your server so we can debug and fix this for you.

    http://www.statcounter.com/contactus.html

    thanks!

    StatCounter Team

  10. Hi guys, I’m still experiencing a problem with the updated plugin, the string “” momentarily appears when opening pages from the admin as well as the blog itself.

    I’m using wordpress 2.3.1 and the site runs on a linux server. I’ve uploaded the PHP plugin file in ASCII mode.

    And also may I know the advantages of this plugin over the conventional copy-pasting of the statcounter code?

  11. Here’s a link to the latest statcounter wordpress plugin in case you can’t find it and was planning to go through the setup once again just to download it:

    http://wordpress.org/extend/plugins/official-statcounter-plugin-for-wordpress/official-statcounter-plugin-for-wordpress.zip

  12. this is awesome news…! being that i just transfered my old blog over to wordpress.. can’t wait to install it… Thanks!!

  13. I’m going to be a spoilsport here.
    I never understood the need for a plugin when it’s a matter of simply inserting the code into the skin. Well, WordPress is like that I guess. Plugins for smallest things, and complicated skin editing.

    StatCounter Team Response:

    Putting the StatCounter code into your footer.php is a fine solution… but the plugin has the advantage of being very easy to install and won’t be effected by wordpress software upgrades.

    Thanks for your comment!

  14. Had the same problem as Jessy and some of the others. Check the StatCounter-Wordpress-Plugin.php file. Mine had  before the <?php at the top. I removed it and everything looks good. There should be no code or space before the at the end. Hope this helps.

    StatCounter Team Response:

    Hi David!

    Thanks for the feedback about the problem. The plugin has been updated and should be fixed. If you have any more issues let us know.

  15. I got the same error messages as jessy above when I tried loading my admin login page – I activated the plugin last night and this morning, I couldn’t access my wordpress admin. I had to delete the plugin file from my server and then was able to log in.
    Further a commenter on my blog got the error message when she left a comment (http://chennette.net/2008/01/06/making-pizza-the-good-eats-way/#comment-1806) and I couldn’t even see her comment until I deleted the plugin.
    I didn’t try renaming the file – does that really work? I just deleted it and reinserted the code into the header page.

  16. I would switch straight over if statcounter ran adsense exit click tracking… Last time I checked it was not available.

Comments are closed.

Try Statcounter free for 30 days

No credit card required. Downgrade to the free plan anytime.

Try it for FREE!