IP anonymizing and its impact on city and country dimensions in Google Analytics

  • Benoît Pointet

IP anonymization is blurring part of an IP, in general to protect its owner's anonimity. One way to do it is to zero the last octet of an IPv4, last 80 bits of an IPv6. That's actually how Google Analytics does it.

Now anonymizing IPs might have some impact on the attribution of an IP to some country and city . How much? I often read it did not impact geolocalization “too much”, yet I never found studies about it.

A few months ago, I launched a small experiment: I tracked traffic to this very blog twice: once with IP anonmyzation enabled, once without.

I then recently started analyzing this data. Here are the early findings of this experiment.

minor impact on country attribution

Within this experiment, the volumes of sessions attributed to a country varies by +/- 10%, yet globally the variation only amounts for less than 2% of total country attributions.

significant impact on city attribution

I restricted the analysis of city traffic to Swiss cities, since this blog sees a lot of traffic from that country and since it is relatively stable in terms of country attribution (<1% deviation).

In this experiment, the volume of sessions attributed to a swiss city varies importantly: between -100% to close to +200%. Globally, the variation amounts for more than 25% of total city attributions for Switzerland.


Anonymizing IPs has only a minor impact on country attribution. One can thus safely decide to move to IP anonymizing his website's traffic data, without losing the “country-level” overview in Google Analytics.

Yet Anonymizing IPs has thus a significant impact on city attribution. One might not be able to trust city attribution anymore after having activated IP anonymization in Google Analytics.

More about it

Next steps

I will continue digging into that data in the coming months, particularly with respect to identifying patterns in the changes of country/city attributions. Stay tuned.

Tell us what you think