Disable Geolocation Collection

Mixpanel’s client-side libraries send user location data, including city, region, and country, as Properties by default. Mixpanel pulls the user’s IP address and sends it to a third-party IP geolocator (MaxMind). MaxMind then returns city, region, and country, and Mixpanel sets those as Properties. The IP address is discarded as Mixpanel does not store users’ IP addresses.

In order to disable or anonymize geolocation data (i.e., not send city, region, and country by default when using a client-side library), you simply need to stop collecting the user’s IP, which will then not populate the city, region, and country properties. At this time, there is no way to selectively disable one or two of the three location default properties. However, you could disable the three default properties and then set your own custom property for the one or two that you’d still like to collect.


If you don’t want Mixpanel to set city, region, and country by default, you can change the config via your init. This will not collect IP and therefore not populate city, region, and country default properties:

mixpanel.init("YOUR_TOKEN", {'ip':false})


To disable IP collection on iOS, make a small change in the Mixpanel library installed on the app, changing:

useIPAddressForGeoLocation = YES


useIPAddressForGeoLocation = NO


To disable IP collection on Android, set useIPAddressForGeoLocation to false (NOTE: only available on Android SDK versions > 5.2.0):

<meta-data android:name="com.mixpanel.android.MPConfig.UseIpAddressForGeolocation"
                   android:value="false" />
Did this answer your question?



Article is closed for comments.