How to Add StatCounter Code to Your Site

I add a counter code to each of my sites. There are several free counters but the one I use (and have for years) is StatCounter. I like the many statistics easily available within StatCounter, as well as being able to hide my counters. Did I mention it’s free?

 

My instructions to add StatCounter code to your site:

Step One
 Go to StatCounter and create an account.
  
 Click on ‘Add New Project‘ to add your site and generate the code needed to install StatCounter to your site. If you need help getting started go to StatCounter’s help section.
  
 Copy the code you created for your counter.
Step Two
 Log in to your site’s Admin and click on the ‘Template‘ tab and ‘footer.php‘ link for the template you are using.
  
 Save a copy of the original code (click here for instructions on how to do this).
  
 Paste the StatCounter code ABOVE the </body> tag.
  
 Save changes and view your site for errors.
Step Three
 Go back to StatCounter. Click the ‘My Projects‘ tab and look for the site you just added. It should now show one visitor. This was you when you checked your site for errors. If you do block your IP address then every time you visit or refresh your site you will be counted as a visitor.
  
 Click here if you have never blocked your IP address in StatCounter
Click here if you have already blocked your IP address in StatCounter and are now adding a new project
How to block your IP address if this is your first StatCounter project
 To block your IP address click on your site’s link (aka project name) and then click on the ‘Visitor Paths‘ link:
Image of the 'Visitor Paths' link
  
 Click the ‘Label IP Address‘ link above your visitor path stats:
Image of where to find the 'Label IP Address' link
  
 Copy the numbers visible in the IP Address box:
Image of where to find your IP address
  
 Click the ‘Edit Settings‘ link:
Image of where to find the 'Edit Settings' link
  
 Paste your IP address in the ‘IP Blocking‘ area, remove the last two numbers and replace them with *.
  
 For example, if your IP address is 24.110.123.12 then change it to 24.110.123.* (make sure you delete only the last two digits and not the period as well). The reason for this is in the event you have more than one computer in your home that you use. Each computer in your home accessing the Internet will have the same IP address except for the last two digits. By replacing the last two digits with an asterisk you will block any computer from your home that visits your site
  
 Click the ‘Edit Project‘ button:
Image of where to paste your IP address
  
 Your IP address is now blocked and your visits will no longer be counted.
How to block your IP address on new projects if you have previously blocked your IP address on a different project
 It is much easier to block your IP address on any additional projects you create if you’ve already blocked your IP address. To block your IP address on new StatCounter projects click on the wrench next to any project that already is already blocking your IP address blocked:
Image of where to find the wrench icon
  
 Click the ‘Edit Settings‘ link:
Image of where to find the 'Edit Settings' link
  
 Click the ‘Update IP Blocking in All Projects?‘ button, putting an ‘x’ in it, and then click the ‘Edit Project‘ button:
Image of how to update IP blocking in all projects
  
 Your IP address is now blocked in all your StatCounter projects. Each time you add a new site to your StatCounter account follow the above steps to block your visits.
.

StatCounter has some very helpful stats. Click the various links on the left sidebar to see what all they have to offer.

Rochelle

Similar niche store strategies:

  1. How to Add Permalinks (or Link-Backs or Trackbacks) to your Site
  2. How to Add ‘Bookmark this Site’ and ‘Refer-a-Friend’ Links to your Site
  3. How to Change the ‘Home’ Link Wording

13 Responses to “How to Add StatCounter Code to Your Site”

  1. Rachel says:

    Nice step-by-step, thanks. Consider doing the same for something like GoStats – I like gostats better because it does have that log limit that statcounter has. Plus it’s overall better ;)

  2. Rochelle says:

    Thanks for the tip on GoStats. I’m sure there are many good counter available but I simply don’t have the time to write instructions for them all.

    Yes, StatCounter has a log limit (meaning they will only keep current stats on the most recent 500 visitors) but I’ve never found that to be a limitation. Everything StatCounter keeps track of is also found in my hosting site’s statistic trackers and if I really want to dig deep I can look there. I find that StatCounter is easy to use and well-organized for my needs.

  3. Cindy says:

    What a great tip…thanks Rochelle! Already I am seeing visits when I didn’t think anyone was really finding me. (o;

    Keep up the great work!

  4. Shelley says:

    Hi Rochelle,

    Do you add the code to all your pages or just the home page?

    Thanks

    Shelley

  5. Rochelle says:

    Shelley,

    I add statcounter code to the footer.php so that it will be on all my pages. The reason I want it on all my pages is so statcounter will keep track of every page that people visit. Having stats just for my home page will do me no good.

    Rochelle

  6. Alice says:

    Where do we put StatCounter now with all these new hybrid templates? The new template footers hardly have anything in them anymore, including no /body tags.

  7. Rochelle says:

    When you login to your blog’s Admin (WordPress) click the ‘Design’ tab, then the ‘Theme Editor’ link. Look on the right for the Footer (footer.php) and click that link.

    You can add the code here. I recommend saving the footer.php code to Notepad before you do anything, in case you need to revert back to it.

    The best place to place the StatCounter code is just above this code:

    Don’t forget to save your changes.

    Rochelle

  8. Alice says:

    Thanks Rochelle. It gets harder and harder to find the familiar spots to put things with all of the customization going on! :)

    Alices last blog post..New Contact Us Link, Update on CRC Site

  9. iboss says:

    very helpful tips i ad thins line in to my site

  10. Sunshine says:

    Thanks Rochelle.

    Being new to working with WordPress, I just love the helpful tips and resources your site.
    For just about every technical challenge I come upon, you seem to address it in some way on another.

    Again much thanks!

  11. Rochelle says:

    Sunshine – Thank you : )

  12. BlabTalk says:

    I’m actually adding StatCounter to one of my forums (using invisible mode). Not many people think about adding a counter to their FORUM….I have been a user of StatCounter now since 1999.
    BTW, you’re all invited to join my forum. I welcome you all. It’s a general talk forum, so whatever you have on your mind, feel free to post there and join in the conversations. Just no spam, please.

Leave a Reply

CommentLuv badge