magenta
magenta

Reputation:

How to filter myself out of Google Analytics with a dynamic IP address?

Does anyone know how to setup Google Analytics to filter yourself out if you're visiting the site from a dynamic IP address? I don't want to include myself in my stats from home use where I have a dynamic IP address via Verizon FiOS.

Upvotes: 16

Views: 14951

Answers (10)

Plippie
Plippie

Reputation: 2886

I recommend to use a 127.0.0.1 (localhost) redirect in the HOST file to block all/any type of abusive sites or domain/trackers/analytic and such. For a large list take a look at the WinHelp website. I have and still use it for all my PC's. You also need to look over the list which domains you do want and remark the lines with a # tag in the list.

All instructions are on the site for different operating systems.

Upvotes: 0

Andy Webber
Andy Webber

Reputation: 111

Setting a cookie to prevent the analytics code from being sent to the browser is by far the best option.

Upvotes: 2

Aviva B
Aviva B

Reputation: 171

Google currently has a browser add-on that will block any visits of yours from showing up in any Analytics. http://tools.google.com/dlpage/gaoptout

Pluses and minuses of this opt-out versus filters are discussed in this blog post.

Upvotes: 17

A.P.
A.P.

Reputation: 305

can't find a way to reply to answers, I second to the hosts file trick: 127.0.0.1 www.google-analytics.com

as it works in all browsers at the same time, as designers often try site in all browsers.

Upvotes: 0

Simon_Weaver
Simon_Weaver

Reputation: 146110

If you're a developer and concerned that you're going to get a bazillion hits while you're developing the site you can add the following line in your analytics tracking code :

 pageTracker._setDomainName(".yourwebsitename.com"); 

Assuming you're hitting a url not ending in .yourwebsitename.com during testing then the tracking code will see your URL is 'localhost' and not 'yourwebsitename.com' and not send any tracking.

Upvotes: 1

guns
guns

Reputation: 10815

Just block the domain where google analytics lives via your system's hosts file:

127.0.0.1 www.google-analytics.com

This is less disruptive than the NoScript plugin mentioned by jdigital, but still makes you effectively invisible to google analytics.

Upvotes: 2

AFHood
AFHood

Reputation: 1050

You can always setup a proxy to tunnel all of your traffic through. Then simply exclude the proxy's IP from the results.

Upvotes: 0

jdigital
jdigital

Reputation: 12286

Consider using the NoScript plugin for Firefox. Just mark google-analytics.com as an untrusted site and you should be all set. A nice side-benefit: better security in your browser.

Upvotes: 4

Chris Fulstow
Chris Fulstow

Reputation: 41902

You can do this by creating a special page on your site that sets a Google Analytics segmentation cookie, using code something like:

<body onLoad="javascript:__utmSetVar('exclude_from_report')">

Then create a custom filter in Analytics to exclude visitors that match the 'exclude_from_report' segment pattern.

Upvotes: 6

Chris B.
Chris B.

Reputation: 90249

There are a couple ways of doing this. If you know the range of IP addresses you're accessing your site from (and don't mind filtering them all out) you can set up an "Exclude" filter for that range of IP addresses. If that's too restrictive, you can set a cookie using the Google Analytics code and filter on that. Both techniques are documented at Google's help system.

Alternatively, if you're dynamically producing the pages on the server, you could simply not write the Google Analytics code into the pages in the first place, based on the currently logged in user. On my site, I'm choosing to write the code or not based on a few things, such as whether the website is running in debug mode or if an administrator is logged on.

Upvotes: 11

Related Questions