Completely masking IP address in JS tracker

Hey, we have been using the IP anonymization enrichment and is really good however since the processing is already in a cloud environment it might impose some legal difficulties.

Is it possible to mask the ip address already in the tracker before data being sent for collection and enrichment?

Hello! What tracker are you using?

Sorry, I should’ve mentioned it! It’s the javascript tracker. (I’ll add this to the main topic as well)

Hi @brajjany, I don’t think it’s possible to mask the IP address of requests going from the tracker as the IP address is a part of each HTTP/HTTPS request which the tracker uses for the API calls.

If it’s enough for you to prevent the IP address from getting to the Snowplow collector, you could make use of a proxy or Google Tag Manager Server Side as a mediator that would mask the users’ IP and forward them to Snowplow.

1 Like

Thanks for your reply @matus. On this page it says you are able to control user and session data being tracked and sent to collection. link

Is there a way to persist information but mask the IP address? I see there’s a clearUserData function that can be used by the exempt some specific fields.

The server anonymisation feature in anonymous tracking (that you referred to in the link) actually works in a similar way as the IP anonymisation enrichment – the IP address is removed on the server side. So the requests from the tracker to the server contain the IP address (this can’t be avoided) but it is then discarded by the pipeline. I think there is a slight difference from the IP anonymisation enrichment in that the IP address is removed by the collector which happens a bit earlier in the pipeline. However, I think the concept is similar.

To answer your question, there isn’t an option to only enable the server anonymisation and not anonymise other user identifiers when using anonymous tracking. The clearUserData function doesn’t help as the IP address is not stored in cookies or local storage.

Yeah - this is correct, there’s no real way to strip the IP address from the HTTP request (or anonymise it) without having some intermediate service between the request and the collector itself. You could do this (e.g., by having a proxy that the tracker sends to first which then forwards to the collector) but whether or not this achieves what you are trying to do relative to legislation likely depends on where you are.