Override user_ipaddress in JavaScript Tracker 3.15.0

I’m trying to not collect the user_ipaddress (but keep collecting domain_userid and domain_sessionid).

This doesn’t seem possible with anonymous tracking (which prevents collection of all 3 fields).

However, the docs say that I could override the value for ip (or user_ipaddress). How can I achieve this (either via an exposed function or by editing the sp.js tracker itself)?

Thanks!

@whitepanda , it is achieved in Enrich. That is while you cannot prevent sending the IP address to the collector (it is a part of HTTP protocol), you can mutate it in Enrich with one of the available enrichments. There are three enrichments that can do the job for you with a different outcome:

  • IP anonymization enrichment is used to mask the IP address
  • PII pseudonymization enrichment is used to hash the IP address
  • Custom JavaScript enrichment is a generic enrichment that has access to all the atomic fields and could be used to override them with a custom values. As the user_ipaddress is defined as a string with up to 128 characters and could be nullable you can replace the actual IP with any string or just nullify it.

The IP anonymization enrichment is the simplest to deploy.

3 Likes