SansWit
SansWit

Reputation: 310

Can I anonymize IPs in Google Analytics and still track unique visitors?

I am most interested in an answer for Android, though it would be great to know if the answer is generalizable to websites, iOS, etc. Can I anonymize IPs (using setAnonymizeIp()) in Google Analytics and still track unique visitors? I understand Google Analytics uses cookies for websites, and so I thought it might be possible (or perhaps even automatic).

Upvotes: 8

Views: 3387

Answers (3)

Ronen Yacobi
Ronen Yacobi

Reputation: 844

Ip address is not the value used to identify a unique visitor/user on Google Analytics, so it shouldn't be an issue. Analytics uses a unique identifier in a cookie or mobile app data so attach to all of the user's hits in order to identify as a unique visitor, so I don't see a reason why ip masking should affect it.

Upvotes: 0

neuron
neuron

Reputation: 1244

I dont know if the accepted answer is correct. I've enabled setAnonymizeIp myself on my app, and it had a huge effect on my analytics results.

Pages/visit shot up. Visits halfed. Avg time on site shot up.

Upvotes: 0

Yahel
Yahel

Reputation: 37305

Yes. The only effect that the anonymizeIp function is that it instructs Google to remove the last octet of the IP address from it's logs.

So, if your user's IP is:

123.45.678.90

And you run this function, Google will store it as:

123.45.678.XX

The only practical effect is that this results in less accurate Geographic reporting, but that's it. It won't affect counts of unique visitors in any way, and is totally unrelated to how GA tracks unique visitors, since Google Analytics does not rely on IP addresses for unique visitor identification. For websites, maintaining unique user identification is done by the Google Analytics cookies. In this specific case, the Google Analytics Android SDK handles the user session management for you using a local storage mechanism analogous to cookies.

Upvotes: 11

Related Questions