Question
How can I prevent Analytics.js from collecting a user’s IP address in my events?
Product
Twilio Segment
Environment
Segment Console
Answer
To prevent Analytics.js from collecting the user’s IP address, you must set { context: { ip: "0.0.0.0" }} on each event call. This tells Segment not to record the IP for that specific request. The override applies only to the individual event, so you need to include it on every Page, Track, Identify, Group or Screen call where you want IP collection disabled.
Additional Information
Learn more about managing user's identification in Managing identity in Analytics.js.