Excluding your own visits from Analytics reports

It is easy to exclude your own visits to your Analytics-tracked site when you have a static IP – you can just filter out all requests from there. It becomes a bit less straight forward when you have a dynamic IP, or on a large network that maps to a single public IP or IP block (say, at work).

It turns out you can use some built-in Urchin functionality to set a cookie on your browser, which you can then use to filter out your own visits. Google also has some help with this, but the former link is much clearer and more complete.

Because I did not want to setup a specific page to do this (as suggested in the article), I just use FireBug to execute the following JavaScript in the context of my site, which will set a cookie that expires in 20 years or so:


, where "no_report" is the pattern you are filtering by in Analytics. The process for defining a filter is outlined here, and you need to configure it like this:

Filter Type: Custom filter > Exclude
Filter Field: User Defined
Filter Pattern: no_report
Case Sensitive: No

Update 2008-02-04: This post was originally published to work with the old Analytics tracking code. Since then Google Analytics introduced a new version of the tracking code. Instead of __utmSetVar(), the equivalent for the new code is pageTracker._setVar('no_report');. I ended up saving javascript:pageTracker._setVar('no_report'); as a bookmark.