Mixpanel Community Icon

Remove Location Data from User Profiles Programmatically

·
·

How to Update user profiles programmatically to remove location data if necessary.

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Hi Japherson M., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹

    Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    To update user profiles programmatically and remove location data if necessary, you can use Mixpanel's SDKs and set the IP address to 0 when updating profile properties. This prevents Mixpanel from parsing geolocation data. Here are examples for different SDKs:1. Java SDK:LBKSJSONObject props = new JSONObject(); props.put("Plan", "Premium"); props.put("$ip", "0"); // do not update profile location JSONObject newUser = messageBuilder.set("sample_distinct_id", props); mixpanel.sendMessage(newUser);LBKSMixpanel SDKs: Java2. Node.js SDK:LBKSmp.people.set('sample_distinct_id', { name: 'sam', plan: 'premium', ip: '0' // do not update geolocation });LBKSMixpanel SDKs: Node.js3. Python SDK:LBKSmp.people_set('sample_distinct_id', { 'name' : 'sam', '$email' : 'sam@​[example.com](http://example.com)', }, meta = { '$ignore_time' : True, # do not update $last_seen '$ip' : 0}) # do not update geolocationLBKSMixpanel SDKs: Python4. PHP SDK:LBKS$mp-> people-> set("USER_ID", array( 'name' => "Samantha", ), $ip = 0);LBKSMixpanel SDKs: PHPBy setting the IP address to 0 in these profile updates, you prevent Mixpanel from parsing and storing geolocation data for the user profiles.

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.

  • Avatar of Japherson M.
    Japherson M.
    ·
    ·

    kapa.ai is there a sample for flutter?

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Let me check the knowledge base for you again. One moment! đź“š

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Yes, there is a sample for Flutter to disable geolocation tracking in Mixpanel. Here's how you can do it using the Flutter SDK:LBKS// disable geolocation from IP parsing mixpanel.setUseIpAddressForGelocation(false);LBKSThis code snippet calls the setUseIpAddressForGelocation() method with false as the argument, which disables geolocation parsing from IP addresses.Mixpanel SDKs: FlutterBy using this method, you can prevent Mixpanel from automatically generating geolocation properties for events and profiles based on IP addresses. This is useful if you want to avoid unintentionally setting your data's geolocation to the location of your server or if you want to prevent geolocation data from being tracked entirely.

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.