Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.


I'm using statcounter to monitor my traffic on the rest of my site. Is there a way to use this on my Vanilla pages as well?


  • Options
    Most statcounters just make you include a file on every page you want counted, so if you want to do that your options are a really simple extension, or a custom theme file. If you're doing lots of theme changes, use the theme, otherwise make the extension.
  • Options
    Thanks Bergamot. I wish I understood your answer! I don't know how to write extensions and I'm not up to themes yet. I'm just altering the CSS to better fit the rest of my site. :/ StatCounter basically has some code you add to each page. It counts the pages with the code. But I'm unsure how to add the code to a PHP page without messing it up. I'm also unsure which pages should have the code on them.
  • Options
    After discussing this issue with the StatCounter support, I was told the best place to insert the javascript, was to put it directly after: 'Vanilla 1.0 is a product of Lussumo. More Information: Documentation, Community Support." This appears in the side bar, but I can't for the life of me find the file that contains this. Can anyone guide me to it/
  • Options
    Wanderer answered this perfectly here:
  • Options

    Here you go, just for you.

    Statcounter 1.0

    Just replace the code in the default.php with your statcounter account code for your project, and it should work without a hitch.
  • Options
    Thank yeeeee!
  • Options
    Alright. So I'm prepared to sound like a dork. I downloaded this, uploaded it to the server, and turned it on in the extensions panel. But it's not working. Where do I actually insert the code? The extension on the site says "Inserts the Statcounter code into the panel." But I can't see where it gets the code, nor how to specify whether to use invisible or not. What am I missing?
  • Options
    From one beginner to another.... I looked at Statcounter, but didn't like the fact that it required (as I understand it) for info to be sent off to Statcounter every time someone looks at your site. Google Analytics works the same way. It is mostly fine, but can occasionally slow down visitors' browsing.

    There are two counters - Slimstat and Shortstat - which I understand do it all on your own computer, which I like better. You will probably want to stay with what you already have working, but there is discussion on these two at

    Hope this is all correct - if not, someone will correct me : )
  • Options
    Without looking at the actual code, from what JP said, i think you'd need to open up the default.php file in the StatCounter folder, and add the code in there Alison. I'm sure he'll be back to confirm that sometime though.
  • Options
    Yes, Minisweeper is correct.

    @Alison - Do you see where it says and down below in the example code? You'll have to create or retrieve your code from your Statcounter account and place it exactly in the same spot. Then you'll save that edited file and upload the directory to your_vanilla_path/extensions/ directory.

    if(in_array($Context->SelfUrl, array("index.php", "categories.php", "discussions.php", "comments.php", "search.php", "post.php", "account.php", "settings.php"))){ $statcounter = <<< ENDCODE <div class="statcode"> <center> <!-- Start of StatCounter Code --> <script type="text/javascript" language="javascript"> var sc_project=1721070; var sc_invisible=1; var sc_partition=16; var sc_security="e8628c17"; </script> <script type="text/javascript" language="javascript" src=""></script><noscript><a href="" target="_blank"><img src="" alt="hit counter code" border="0"></a> </noscript> <!-- End of StatCounter Code --> </center> </div> ENDCODE; $Panel->AddString($statcounter,150); } ?>

    If you choose in Statcounter for the counter to be invisible you actually won't see anything in the sidepanel. But if you choose to display a counter, that counter should show up at the bottom of the panel. It won't display below the copyright info though. But I think somewhere towards the bottom is a good place for it.

    Let me know if you need any more help.
  • Options
    Ah, that works now as well! ercatli, the link didn't work for me.
  • Options
    Sorry, it doesn't work for me either, but this should -
This discussion has been closed.