Solved

Disable IP Address Tracking via Tracking Object

  • 16 August 2021
  • 7 replies
  • 1428 views

Badge +1

Hi there! 

I’m new to using Amplitude and I was trying to disable IP address tracking in the initialization of the Amplitude instance. Even after adding a tracking object to disable the tracking, the IP address is still being collected. This is the initialization of the code that I had: 
 

amplitude.getInstance().init("{{amplitudekey | safe}}", {     trackingOptions: {      city: true,      country: true,      carrier: true,      device_manufacturer: true,      device_model: true,      dma: true,      ip_address: false,      language: true,      os_name: true,      os_version: true,      platform: true,      region: true,      version_name: true,     },});

 Is there something I’m doing wrong or missing? Thanks in advance for the help!

icon

Best answer by eddie.gaona 16 August 2021, 21:58

View original

7 replies

Userlevel 7
Badge +10

Hey @carissa.mok ,
Amplitude’s doc states the following wrt opting out for property tracking which might help to understand this behavior if your code setup is correct - 

The trackingOptions configurations will only prevent default properties from being tracked on newly created projects, where data has not yet been sent. If you have a project with existing data that you would like to stop collecting the default properties for, please contact our Support team at support.amplitude.com. Note that the existing data will not be deleted.

If you really need to disable tracking for all users in an already created project, the Amplitude Support team has a backend tool to help disable Lat/Long/IP address etc for your users moving forward.

Hope this helps!

Badge +1

Hi Saish, 

I saw that blurb too, so I actually tried to create a new project that didn’t have any data sent over yet in order to try initializing with the tracking object and the IP address still sent. 

Userlevel 5
Badge +9

Hello @carissa.mok! Looks like you are trying to disable the collection of IP Addresses but running into some trouble.

The code to disable this should look like the following and making sure this is set up in a new project where no data has been collected:

amplitude.getInstance().init("API_KEY", null, { // optional configuration options 
saveEvents: true,
includeUtm: true,
includeReferrer: true,
trackingOptions: {
city: false,
ip_address: false,
} });

Could you try this code in a new project, please?

Badge +1

Hi @eddie.gaona, I just tried that and it seemed to do the trick—thanks so much! I just had a couple quick followup questions:

  1. What is the null value for, userID possibly?
  2. If I want to change any of the properties in the initialization, will I have to do it in a completely new project to reflect the changes?
Userlevel 5
Badge +9

Hello @carissa.mok,

Happy to answer in the same order!

  1. User IDs are set by the customer and if you are seeing null values it means that there was no User ID present for that event. More information can be found here
  2. The options need to be set before data gets ingested into the Amplitude project. If there is data then you will need to create a new project.
Badge +1

Hi @eddie.gaona, thank you so much for all of your help -- really appreciate it!

Hello, 

how can I disable IP tracking in Go SDK?
Couldn’t find same options posted in the first answewr for Go’s Documentation.

Kind regards

Reply