Posted By

JonasDoebertin on 02/09/11


Tagged

google tracking Analytics anonymizeIp


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

lkovacs


Google Analytics: Anonymize IP Adresses


 / Published in: JavaScript
 

Use this line to anonymize IP adresses in Google Analytics:

gaq.push(['gat._anonymizeIp']);

  1. var _gaq = _gaq || [];
  2. _gaq.push(['_setAccount', 'UA-XXXXXX-X']);
  3. _gaq.push(['_gat._anonymizeIp']);
  4. _gaq.push(['_trackPageview']);
  5.  
  6. (function() {
  7. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  8. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  9. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  10. })();

Report this snippet  

You need to login to post a comment.