US: (831) 440-7361
India: +919830271197
We Create Websites We Market Websites

Excluding Dynamic IPs from Google analytics

(Complete list of important GA FAQs at /edu/google-analytics.html)
It is very important to exclude all internal IPs (else it inflates the traffic count, esp the average time spent on pages, at times). After installing the GA on SEOForClients.com, I realized that I am behind a dynamic IP (Where the ISP assigns you a new IP everytime you log in). To exclude the Dynamic IPs, please read http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55481. It explains about static IP (and IP range) exclusions and Dynamic IP exclusions.

To exclude traffic by Cookie Content

Note: This is an advanced alternative to the previous method.

To exclude traffic from dynamic IP addresses, you can use a JavaScript function to set a cookie on your internal computers. You’ll then be able to filter all visitors with this cookies from appearing on your Analytics reports.
How to exclude traffic by cookie:

  1. Create a new page on your domain, containing the following code:

    (Please note that this code is in addition to the Google Analytics tracking code that you have on every page of your website.)
  2. In order to set the cookie, visit your newly created page from all computers that you would like to exclude from your reports.
  3. Create an Exclude filter to remove data from visitors with this cookie. Follow these instructions http://www.google.com/support/googleanalytics/bin/answer.py?answer=55494
    to create a filter with the following settings:

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

(Please do let me know if you face any problem with it)

How does Dynamic IP exclusion work and how to optimize it?

I created a different page (Say Page exlude-google-analytics.php) where I installed this code. Sorry, can’t give access to the page (Rule 1, don’t make it public else a lot of visitors will stay filtered). Whenever you visit the page exlude-google-analytics.php, it allows Google to create a cookie value. When you visit another page of the domain, Google checks the cookie value and decides to ignore your visits. But I needed to make sure that every time I access the page before accessing Google analytics (Not taking a risk of a deleted cookie). I use a different browser for checking Google analytics, so I made the page (exlude-google-analytics.php) the default page for the browser. In this way I am 100% sure that I am with the right cookie. [Note: Do remember to follow rules of Good website designing while creating this new page]

I am not sure about Dynamic IP exclusion

I am assuming that it sets cookie value only for the specified domain but it is not written anywhere. Since it is a creating a Google analytics related domain cookie then it is accessible for any domain that has the Google analytics installed. To play safer, I have included a not so obvious variable pageTracker._setVar(‘test_****‘); (not the default one).

Tags: , , ,

Tuesday, January 13th, 2009 Analytics
Leave a Reply

« Back to text comment
Get a Custom Quote & Free Website Review (Report includes 200+ keywords, ranking & more - worth $200)