Anonymize IP address globally

The docs mention passing a value to IP in context options. We'd like to prevent tracking IP at all. How can I disable this globally for analytics.js?

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Gregg B  - thanks for writing in and thanks for checking out the docs as well!


    We don't currently offer a setting or option for globally anonymizing the IP address for analytics.js. The guidance you saw in our documentation is the suggested means of preventing any capture of the IP address.


    The only caveat to this, is with Google Analytics as a destination. Google Analytics provides a Destination setting to allow anonymizing the IP address for the dataset that they receive. Generally, though, our prescribed approach is to overwrite with a default IP via options.context.ip.


    Please let me know if you need anything else.


    Best Regards,



    Solution Architect | Segment

    Reply Upvote
  • Thanks for the reply Aimee Menne . If I can make a suggestion for a future release:

    Having the method parameters be a single object, with fields for each value they require, would make working with the library a great deal easier. As it is now the options argument can be at different indexes of the arguments list.

    And, well, I guess a global options object for things like this would be nice too.

    Reply Upvote
  • Gregg  I will raise a feature request for future consideration around optionally suppressing IPs from client-side sources.


    Thanks again and have a great day.



    Reply Upvote
  • It would be great if Segment had IP anonymization feature similar to Google Analytics.

    Instead of scratching the whole IP address with `` it could mas the last byte like this:
    `` --> ``

    This is great for keeping tracking compliant with GDPR and still have geo analytics. 

    Reply Upvote