You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this library server-side, proxying analytics data from the client. I want to anonymize IP addresses before sending them to GA. I am currently doing this:
/* * Perform local IP address anonymization. * We are also instructing GA to anonymize IPs on GA end, * but it is technically and legally safer to anonymize locally. * Anonymization rules are the same as those used by GA, * i.e. zero last 80 bits of IPv6 and last 8 bits of IPv4. */InetAddressip = InetAddress.getByName("12.34.56.78");
byte[] address = ip.getAddress();
intanonymizedBytes = ipinstanceofInet6Address ? 10 : 1;
for (inti = 0; i < anonymizedBytes; ++i)
address[address.length - i - 1] = 0;
returnInetAddress.getByAddress(address).getHostAddress();
I guess many people could use IP anonymization for compliance reasons. It would give your library a privacy edge. Consider adding this as an option. Thanks.
The text was updated successfully, but these errors were encountered:
I am using this library server-side, proxying analytics data from the client. I want to anonymize IP addresses before sending them to GA. I am currently doing this:
I guess many people could use IP anonymization for compliance reasons. It would give your library a privacy edge. Consider adding this as an option. Thanks.
The text was updated successfully, but these errors were encountered: