February 22, 2006
Exclude Internal Visits from Google Analytics
Back in November, Amit Agarwal wrote about preventing Google Analytics from tracking visits via an edit to the Windows Host file. This is an effective work-around for excluding traffic from internal PCs with dynamic IP addresses, but tweaking the Hosts file is a bit tricky for the average user. Plus, if you've got dozens or hundreds of employees, it's really not practical.
Using Google Analytics' Visitor Segmentation, you can achieve the same result, much more efficiently and with a lot less work on your internal users' end.
Create a hidden page on your website, using the following
tag:<body onLoad="javascript:__utmSetVar('internal');">
In the best case scenario, this page is hosted behind a password-protected Employees Only area. You can also use a link, calling the __utmSetVar function via an onClick event, if you so choose.
Now broadcast the URL for this page only to the employees you wish to exclude from Google Analytics' data.
Lastly, create an Exclude Filter with the following criteria:
- Filter Type: Exclude
- Filter Field: User Defined
- Filter Pattern: internal
- Case Sensitive: Off
Don't forget to apply the filter to your profile.
Once your employees visit the page, their browsers will be tagged "internal" and their transactions, page views, and clickpaths will be excluded from your data.




