How To Keep Your Blogs Statistics Accurate

Everyone who has a site check their stats from time to time to know how their site is performing. I know I check my site’s stats almost every hour.

I also check my site’s homepage and posts from time to time to ensure that there are no spelling mistakes and other problems like image not displaying properly.

But by doing this we are rendering our own stats inaccurate.

How to fix this

Almost every stats package you would try requires you to insert a little chunk of Javascript (or similar) into your template, usually at the bottom so it’s the last thing that loads.

All you have to do is tell your Content Management System (CMS) to not include that code if you are logged in. That way your own hits aren’t logged so your stats more accurately reflect how many visitors your site is getting and what they’re looking at.

For those of you who use WordPress this is very simple. The function that you need to let WordPress determine whether or not to include this code is the is_user_logged_in() function. So your code should look like this:

< ?php if(!is_user_logged_in()) { ?>
Insert your stats package inclusion code here
< ?php } ?>

This will work no matter where your code has to be included, and will work each and every time whenever you’re logged in.

via Jonic’s Blog (link removed because the page does not exist anymore)

Read posts on your favorite topic


Blogging | Make Money Online | WordPress | SEO | Internet

Software | Google | Tutorials | Tweaks | Others

Get tips on Blogging and Making Money Online via Email for FREE

Enter your email address:

Must be valid. No spam from me, promise. Or read via RSS.


Copyright ©2005-2011 JohnTP, All rights reserved.