Hi, is there an option to eliminate the sending of the "City" property in all events? (Mixpanel property)
Yes, there are a few ways to prevent the $city property from being sent, depending on your setup:
Option 1: Disable Geolocation Entirely
Since $city is derived from IP-based geolocation, the most straightforward approach is to disable geolocation tracking. Note that this will also disable $region and mp_country_code (Country) โ there is currently no way to disable only one or two of the three geolocation properties. [Default Properties] Here's how to do it per SDK: JavaScript
mixpanel.init("YOUR_TOKEN", { ip: false });[JS SDK] iOS (Swift)
let options = MixpanelOptions(token: "YOUR_PROJECT_TOKEN", useIPAddressForGeoLocation: false)
Mixpanel.initialize(options: options)[Swift SDK] Android
<meta-data android:name="com.mixpanel.android.MPConfig.UseIpAddressForGeolocation" android:value="false" />[Android SDK] Node.js
const mp = Mixpanel.init('<YOUR_TOKEN>', { geolocate: false });[Node.js SDK] PHP
$mp = Mixpanel::getInstance("YOUR_PROJECT_TOKEN", array(
"events_endpoint" => "/track?ip=0"
));[PHP SDK]
Option 2: Blacklist the Property (JavaScript only)
If you're using the JavaScript SDK and want to prevent $city from being sent as a default property, you can use the property_blacklist config:
mixpanel.init("YOUR_TOKEN", {
property_blacklist: ['$city']
});Option 3: Block the Property in Lexicon
You can also block the $city property in Lexicon from the Mixpanel UI. This will prevent any new data for that property from being stored going forward (though previously ingested data will remain). Only project owners can do this. [Blocking Data]
Recommendation: If your goal is full privacy compliance, Option 1 (disabling geolocation at the SDK level) is the most thorough approach.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
