Counting Hits and Referers – now there's two ways

b2++ and WPMU have long been able to record hits and referers. Now you can do it in two different ways!
The original way to record hits in WPMU was by adding this code to your index.html template:

{insert name='getreferer'}

but if you’re not sure that the web page is refreshed every time your blog is loaded you can insert the following html instead:

<script type="text/javascript" language="JavaScript1.2" src="{$siteurl}/wp-counter.php"></script>
<img src="{$siteurl}/wp-counter.php?page=img&loc={$smarty.server.SERVER_NAME}/{$smarty.server.REQUEST_URI}" alt="Stat Counter" border=0>

As usual, replace the quotes in the code above with regular shift-2 characters.

Here’s what the referers listing looks like in your backend:

Author: Donncha

Donncha Ó Caoimh is a software developer at Automattic and WordPress plugin developer. He posts photos at In Photos and can also be found on Google+ and Twitter.

1 thought on “Counting Hits and Referers – now there's two ways”

Leave a Reply