If you use google analytics on your blog, here is a small clue on how to get your own visits to your blog filtered for it.
As a blogger, you will probably visit your own site very often, to answer comments or check design tweaks or what ever.
All these hits are being tracked by analytics by default. But with this little trick, you can trigger the analytics code only when another user visits your blog, but not when you visit it.
Put this to your footer.php just before the </body>-Tag.
<?php
get_currentuserinfo() ;
global $user_level;
if ($user_level != 10) {
echo'
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-XXXXXX-X“;
urchinTracker();
</script>
‘;
}
?>
And replace the XXXXXX-X with your actual analytics-ID. From now on, every time when you visit your blog, while you are logged in as an admin, the analytics code won´t be triggered.
The if ($user_level != 10) checks, whether the visitor is an admin (WordPress-UserLevel = 10).
Thank you for visiting my blog. There are new posts here every day. Staying updated is easy: Just subscribe to my RSS feed or subscribe to FREE eMail updates. Thanks for visiting!
Enjoyed this article?
Please subscribe to my RSS Feed!
Subscribe by Email
Get notified by email
on every new article!
The Latest From the Top Blogs About Blogging...
3 Responses to “Filter yourself from google analytics”
Leave a Reply
1 Trackback so far
-
Great SEO Tips at MarcoRichter.net | Learn SEO | SEO Techniques and Tools
December 13th, 2007 at 10:59 am[…] Filter yourself from google analytics: Shows you how to filter out your own blog visits so your google analytics provides a more accurate count of your visitors. […]

November 30th, 2007 at 4:21 pm
Good suggestion. I have used this for awhile myself (a bit different code for me). Is this for Wordpress? Also, I think this implies that you are logged in for it to not trigger Analytics, so your own visits to the home page will still trigger a few extra visits.
December 1st, 2007 at 7:01 am
Neil, you´re right. This works for WordPress and you have to be logged in. Most of the time, when I do visit my blog, I am logged in.