This UserScript checks each inline script embedded in a web page, whether a Google Analytics Tracker is constructed therein. If that is the case, it surgically 😉 inserts an Analytics-API call to the _anonymizeIp() function, thus requesting the masquerade of the IP.
New: As an experimental feature you can also enable the handling of asynchronous trackers. A call to _anonymizeIp() is pushed into the _gaq command queue in these cases.
You may consider it one step in direction of an alternative to the Google Analytics Opt-Out Addons available for other major browsers. …
You may turn on or off features or set options in the config section of the script. This section is located between [user configuration] / [/user configuration] markers.
This script has not been extensively tested yet! (I use to block analytics via Opera's urlfilter feature, anyways.) 😉
Version 1.11 [2010-06-01]
- Support being managed by ”UJS Manager“ Opera-Unite App.
Version 1.10 [2010-06-01]
- Experimental asynchronous tracker (_gaq) support implemented. Turn feature on setting featureGAQmaskip to true in config section.
Version 1.00 [2010-05-26]
- Initial version.
4 Replies to “Google Analytics IP Masking (UserJS)”
Had that ready for a long time. ,) Just didn’t upload…
May be you can make the user settings UJS-Manager ready. That would allow the user to switch between the values without the need to search for the script on his HDD to open it with an external editor :)See ujs_configuration.html for more info.
I implemented an experimental handling of asynchronous trackers. It pushes a function calling _anonymizeIp() on _gat into the _gaq queue each first time (per script) a queue-push is discovered.This feature has to be enabled editing the script! And I’m not yet sure, if that works (althoug I have some indication it does) – even more unsure, if older API versions choke it.
Hey there!Thanks for your script. Can you give us a hint in the Google Forum at http://www.google.com/support/forum/p/Google+Analytics/thread?tid=2c5e83b562b3b78b on how to get it work with the asynchronous version, please? Does the anonymize_Ip; line have to be called before the getTracker?!Thanks in advance.Erk