How to Exclude Internal Traffic from Google Analytics when Internal IP Address is Dynamic

Google Analytics has a build in filter that allows you to traffic from an IP address. It works fine when you have a static IP but when the IP is dynamic is does not work (If you are not familiar with how IP filtering works then I will write about it later). In this post I will explain how to exclude internal traffic using a method other than IP address

Use Custom Filter

Custom filter allows to exclude traffic by Cookie Content set via setVar.

To exclude traffic from dynamic IP addresses, you can use a JavaScript function to set a cookie on all internal computers and browsers. You’ll then need to create a filter to exclude any traffic that has that cookie set.

How to exclude traffic by cookie:

  1. Create a new page on your site that sets the Custom Variable (User Defined) value in a cookie. The way you do is as follows<body onLoad=”javascript: _gaq.push([‘_setVar’, ‘Exclude’]);”> – Note this code is in addition to your Google Analytics tracking code on your page
  2.  Let’s call this page do-not-track-me.html
  3.  Visit http://www.yourdomian.com/do-not-track-me.html page from all computers and browsers that you would like to exclude the traffic from i.e. all your internal computers and browsers. (Once set, you can check this value by looking at _utmv cookie on your computer)
  4. Create an Exclude filter to remove data from visitors with this customer variable value:

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

Note: If at any point you override the cookie or delete the cookie, your traffic will no longer be excluded.

Please follow and like us:
Pin Share

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

RSS
Follow by Email