Statcounter WordPress Integration – Best Practice

Written by Pavan Kumar on December 4, 2008



Traffic measurement - stat loggingCounting the traffic stats becomes an important job of a webmaster and almost every blogger does the job of logging user (visitor) activity, may be not to a great extent, but at least the basic one. Even I am not an exception. I use third party scripts like Statcounter and Google_Analytics for measuring all stats of this blog. The one to which I login most is statcounter. Google Analytics simply mails me the daily stats and I just check the pdf file.

Coming about stat counter usage, there is an official statcounter plugin available if you are a newbie and wish not to play with codes. If you want to integrate the code into theme, its easy – not a problem at all, no coding knowledge is required.

Its my usual practice that I install such tracker at the top of the page – in wordpress, header.php. My SC project is old one and it does not have Exit Links and Exit Link Activity tracking option. This feature is available for new projects where projects will be under Stat Counter Version 4SC4. All old projects are said to be converted to this version, but it will take some time.

web traffic generationComing to my problem, I wanted to track exit links – I want to spy you 😉 guys to know where you go from my site. I created a new project and used that along with the existing one at the same header.php. The reason I choose header though they suggest footer is that in most of the slow connections, people don’t wait to load all the content, they just wait to load the required content and simply press Esc [Firefox shortcut for Stop]. But my aim is not completed with that – placing statcounter code at header will not track exit links.

If you want to trace Exit Links, use the statcounter code near the end of the page. It is mandatory that the link to be tracked should be above the statcounter code section.

  • In WP-Admin open Theme Editor.
  • Open Footer.php
  • Search for </body> – Firefox shortcut for search – Ctrl+F.
  • Add the statcounter code "above" </body> tag and you are done. You may choose to place according to your wish if you want to track only outgoing links of post content, or post content+sidebar or use my way to track ALL outgoing links.

Thanks to guys at statcounter support team for their superior service. They answer to our queries quickly and you will never be ignored :)


Subscribe to RSS Feed or Get updates on your inbox:

People who liked this also read:

Category: featured, internet



8 Readers responded to this post

Somehow my initial experience with statscounter was not good, probably because my blog was hosted on a free webhost. I am quite happy with Google Analytics and recently started to use WOOPRA as well. Again WOOPRA seem to have some problems, its still in beta so can expect it to get better

Right now statcounter for my blog also tracks exit links. It started working after i did what you mentioned above.


Statcounter would be good for low traffic time. The free limit is just 500. I never felt it bad. And I wonder how it won’t work on free hosts :(


Wow, cool :)

I’ve tried many different systems – so far I’ve determined that gostats is best of breed. however, I do appreciate your details. Did you know that you can get a lot more features and not have a limit with gostats?

i have not used statcounter before and to be honest i don’t plan to. i tried different stat tracking systems, analytics included, but i stick with wordpress stats. simple, integrated and provides me with all the info i need. this tip though is crucial to anyone using them because misplacing your tracking code can be easily done and harm the outcome. very nice advice and article!

im a statcounter user and am pretty satisfied with it. very helpful post especially for WP users. ^_^

Thank your for the TIP.
I’m using the INOVE Theme and intergrated the statcounter script in the footer.php and now it appears exactly in the bottom bar. Here’s the site and the code:


var sc_project=XXXXXXXXXXX;
var sc_invisible=0;
var sc_partition=55;
var sc_click_stat=1;
var sc_security=”XXXXXXXXXXX”;

<script type=”XXXXXXXXX’

I ALREADY knew how to do this, (been using Statcounter since 1999) but thanks anyway!! Hehehehe!

2 Blog responses for this post
Leave Your Comments Below / Trackback

About The Author

    Pavan Kumar

    Pavan Kumar completed Engineering in Electronics and Communication in the year 2008. He is very enthusiastic and keen to work on different aspects of computer, internet and mobile related fields. The articles here reflect his creativity. This blog was started as a showcase of solutions for different problems and today it has got a good reputation in the blogosphere. Read More...

© 2015 - All rights reserved.

All content provided in this site are the property of and is free for non-commercial usage. Read our Privacy Policy here.

Any kind content on this site cannot be reproduced in any form without permission of the author. We are not responsible for any loss or damage which may occur due to any of our content.

Site hosted on Bluehost powerful servers.