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).
The IP-anonymization feature in Universal Analytics sets the last octet of IPv4 user IP addresses and the last 80 bits of IPv6 addresses to zeros in memory shortly after being sent to Google Analytics. The full IP address is never written to disk in this case.
Why anonymize IP addresses? According to the GDPR, IP addresses are considered as PII (Personally Identifiable Information). So if you use a Google Analytics account, you'd require to prevent the storage of your website users' IP address information.
From the Select filter type menu, select Exclude . From the Select source or destination menu, select traffic from the IP addresses. From the Select expression menu, select the appropriate expression. Enter the IP address or a regular expression.
Leave the Filter Type as Predefined. Click the Select filter type drop-down menu and select Exclude. Click the Select source or destination drop-down menu and select traffic from the IP addresses. Click the Select expression drop-down menu and select that are equal to.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With