Frequently Asked Questions:

FAQ: Where does my Statcounter code go?

If you’re using Statcounter to track your hits, this is where you insert the tracking code:

In your WP Admin area, go to “Design” (”Presentation” in old versions of WP) –> “Theme Editor” and open up the file called “Header (header.php).” Insert the code right AFTER this line:

<body class="<?php sandbox_body_class() ?>">

Then save your changes.

Related post:  Adding Google Analytics tracking code to your blog

Questions? Instead of emailing for support, leave a comment below so everyone can benefit from any clarification.

23 Responses to “FAQ: Where does my Statcounter code go?”

  1. On Pam Campbell said:

    <body class=”"oncontextmenu=”return false” ondragstart=”return false” onselectstart=”return false”>

    sc_project=3666946;
    sc_invisible=1;
    sc_partition=44;
    sc_security=”0f37ab26″;

    Like this??

  2. On Jared said:

    Pam Campbell » that doesn’t look like the right code to me. are you sure that’s what the statcounter website told you to paste in?

    it may be that i’m not seeing it right, because sometimes when you paste html into comments, you lose some of it…

  3. On Seth Palmer said:

    I deleted the stuff under the <body …etc. part thinking that it was my statcounter html bcs. sitemeter is all screwy…anyway, I screwed up my website by taking 2 lines out that were under this part…any idea what that was? I think I need to put it back in…

  4. On Dan said:

    Can you use Google Analytics and Statcounter at the same time?

  5. On Jared said:

    @Dan: I don’t see why not… But I don’t see why… :)

  6. On Lauren said:

    Hi, ive entered:

    var sc_project=3985174;
    var sc_invisible=0;
    var sc_partition=48;
    var sc_click_stat=1;
    var sc_security=”3a06fb15″;


    Exactly where it said to put it (I hope), and my statcounter is at the top LHS of my site, I’d really like it down the bottom, in the ‘header’ section – any ideas how to move it?

  7. On Jared said:

    @Lauren: try pasting it into the footer.php file, right before the </body> tag

  8. On Lauren said:

    Thank you!! That looks a lot better.

  9. On Sarah Lane said:

    I think that is the same code that I just removed to disable the right click… So now where should I put it? Thx!

  10. On Jared said:

    @Sarah Lane: yeah, if you read carefully, you’re supposed to paste the statcounter code right after that chunk, whereas for the disable right-click you are actually editing that line.

  11. On amanda said:

    If I’m using google analytics, do I also need to use Statcounter or do I only use Statcounter if I’m not using goggle analytics? Just making sure before I do something I shouldn’t (or don’t something I should).

  12. On Jared said:

    @amanda: you really only need one or the other.

  13. On Jamie said:

    I just put the code for Statcounter after
    <body class=”">
    and before
    oncontextmenu=”return false” ondragstart=”return false” onselectstart=”return false”>
    On my blog site I am getting:
    oncontextmenu=”return false” ondragstart=”return false” onselectstart=”return false”>
    on the top left corner. How do I get that off my page?

  14. On Aris said:

    The same thing that happened to Jamie, happened to me:

    I just put the code for Statcounter after

    and before
    oncontextmenu=”return false” ondragstart=”return false” onselectstart=”return false”>
    On my blog site I am getting:
    oncontextmenu=”return false” ondragstart=”return false” onselectstart=”return false”>
    on the top left corner. How do I get that off my page?

  15. On Jared said:

    @Aris & Jamie:

    you put the statcounter code completely on a new line after the body tag, not in the middle of the tag. you’ll need to reset the body tag to how it was.

  16. On Jamie said:

    Thanks! I took the directions quite literally. Sorry, I’m new to this.

  17. On Aris said:

    Hi Jared,
    I did again and it is still on top of the page.
    What can I do now?

    Thanks

  18. On Jared said:

    @Aris: sent you an email.

  19. On Chris said:

    Ok, Now I’m having the same problem as Jamie and Aris. I thought I would reset the body and for fear of resetting the entire website I deleted most everything on the reset page except for the word ‘Body’ within the reset part and now I’ve messed up my reset link. Any help would greatly be appreciated.

  20. On Poker Australia said:

    Hey just found this blog, been looking around at a few websites but this post is one of the best I have seen. Good work!

  21. On Michelle Obama said:

    thought about grasp more me happy to see stuffed with misinformation as long as Excellent I’ll go ahead and

  22. On Kathlene Marrano said:

    Can I publish your put up to my weblog? I will add a backlink to your forum. That’s one actually candy post.

  23. On Mary Hugar said:

    Hey – nice weblog, just wanting around some blogs, seems a fairly good platform You Are using. I’m at the moment utilizing Drupal for a couple of of my sites but trying to change considered one of them over to a platform very much the same to yours as a trial run. Anything in particular you’d advocate about it?

Leave a Reply