Due to data protection guidelines, you should make sure to use the IP anonymization command correctly.

If the integration on your website is being marked as wrong or crawlers cannot identify it correctly you can check the following:

  • Are the commands in the right order?
    The commands must be listed in the right order in your source code. The data has to be anonymized first before it is sent:
    ga('set', 'anonymizeIp', true);
    ga('send', 'pageview');

  • Did you spell it right?
    The field is spelled "anonymizeIp" – lowercase "a", uppercase "I", lowercase "p"

  • Is your code valid?
    Please make sure that your code is not outdated. You can find Google's official guidelines here: https://developers.google.com/analytics/devguides/collection/analyticsjs/ip-anonymization

  • Are you using the code more than once?
    Only use the "anonymizeIp" command once in the source code of your page.

Depending on whether you use classic Google Analytics or Universal Analytics, there are two ways of embedding the anonymization code in your website's source code:

1. Classic Google Analytics (using ga.js JavaScript library)

<script type=""text/javascript"">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);


2. Universal Analytics


(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

ga('create', 'UA-XXXXXXX-X', 'website.de');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');


Did this answer your question?