The ROI Revolution Blog
« 9 Step System for Powering Website Profits | Main | DM News Article: Google Analytics Will Raise the Bar for Entry-Level Web Data Analysis »
Exclude Internal Visits from Google Analytics
February 22, 2006
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.
Interested in learning more about Google Analytics?
Attend our LIVE Google Analytics Seminars for Success training in Atlanta, GA Wednesday, April 14th, 2010 and Thursday, April 15th, 2010 or get the latest tips and tricks sent to you via our free, twice-monthly Google Analytics newsletter.
Posted by Michael Harrison, Analytics and Optimization Specialist at 5:29 PM
Comments
Fred,
Your "internal" cookie will not, by default, transfer from domain to domain, as Google Analytics uses only first-party cookies. You will only be excluded from the reports of the profile with the filter on it... not by any others.
Hope that answers your question.
May 1, 2006 4:54 PM
What happens if our internal users use an alternative browser? Do they need to connect to the broadcast URL again in that browser? What happens if the same internal users are off-site in a conference facility? Or if they reset their cookies?
September 29, 2006 1:38 PM
Jonathan,
If your internal users are on an alternative browser or if they reset their cookies, they will need to re-connect to the broadcast URL again before they will be filtered out.
September 29, 2006 3:10 PM
As I understand this:
1. A cookie is created by the function.
2. For all sites in my Google profile, (I have a main site and subdomains in my profile) GA won't count me UNLESS I delete my cookies.
3. If my site re-prompts me for login info I have likely deleted my cookies and should re-enable this cookie.
4. this will work thru DHCP IP address changes.
This sure sounds better than figureing out whe Verizon changed my address and tweaking the filter.
October 23, 2008 9:51 PM
@David: You're correct. It's pretty much foolproof.
November 3, 2008 2:50 PM
Hi,
I'm trying to understand exactly what happens when you create the cookies with multiple sites too.
As I understand this:
1. A cookie is created by the function.
2. For all sites in my Google profile, (I have a main site and subdomains in my profile) GA won't count me UNLESS I delete my cookies.
3. If my site re-prompts me for login info I have likely deleted my cookies and should re-enable this cookie.
4. this will work thru DHCP IP address changes.
On point 2 here, what happens if you have multiple domains on the same account?
And when you call __utmSetVar('internal'); how do you know which domain you are creating it for?
Sorry to be dense but I can't see the links here.
June 4, 2009 6:12 AM
Presumably we have to initialise both gaJsHost and pageTracker at the bottom of the hidden page in the usual manner too?
June 8, 2009 9:28 AM
I wasn't sure how to do this because I use Blogger.com. I found this solution and it works:
http://mlawire.blogspot.com/2009/07/blogger-exclude-your-visits-from-google.html
July 19, 2009 10:46 PM
@Bill: Cool! Thanks for sharing.
August 19, 2009 10:33 AM
@rutherford: That is correct.
Receive new blog posts immediately direct to your email inbox!











what if I am tapped as internal and I visit someone else's page that has the same code, would I not show up on their results either
May 1, 2006 3:56 PM