Google Analytics: Anonymize IP Adresses


/ Published in: JavaScript

**Use this line to anonymize IP adresses in Google Analytics:**

_gaq.push(['_gat._anonymizeIp']);


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.