Can I anonymise IP addresses when tracking?
Last updated: 4th February, 2019
Yes. If privacy laws in your country require you do not track IP addresses, or if you would prefer to not track IP addresses, you can use the the
anonymizeIP configuration option in the tracking code to do this.
Note: this will only anonymise new IP addresses going forward, it will not affect data that you have previously tracked.
How does it work?
Wherever you've installed the GoSquared code snippet on your site, you'll need to add this extra line of code just underneath it:
_gs('set', 'anonymizeIP', true);
This tells GoSquared to track IP addresses with less precision so that they remain anonymous.
For IPv4 addresses, the anonymise option drops the last octet (8 bits) of the IP address.
For IPv6 addresses, only the first 3 words will be tracked.
Full technical documentation can be found in our API docs – learn more
Will it affect the accuracy of tracking?
It will have no impact on most GoSquared features. GoSquared uses cookie tracking, not IP, to tag visitors and remember if they are new or returning. However GoSquared does use the IP address for geolocation so that you can see which country/city a visitor is browsing from.
anonymizeIP, GoSquared will still track an IP address, but with less precision. This means that the location information will be less precise – which is a good thing for protecting a visitors anonymity. For example, you may only see the country they are from rather than their city.