Mixpanel Community Icon

Managing User and Event Location Data in Flutter with Mixpanel

·
·

Hello I am working on a flutter project right now and has integrated Mixpanel into it. I would like to ask how to manage user locations and event locations. We need to remove the location data for every users and events sent. Currently I called the "setUseIpAddressForGeolocation" method and set the value to true, so the new Events sent has no geolocation in the default properties. The problem is the existing events still has these data and also for the Users, location data is also saved. Is there a way to remove these?

  • 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
    ·
    ·

    Hello! I'd be happy to help you with managing location data in your Flutter project using Mixpanel. Let's address your concerns step by step:1. Disabling geolocation for new events: You've already taken the correct step by calling setUseIpAddressForGeolocation(false). However, there's a small correction needed in your implementation. The method should be called with false to disable geolocation, not true. Here's the correct usage:LBKSmixpanel.setUseIpAddressForGelocation(false);LBKSThis is documented in the Flutter SDK documentation.2. Existing events with location data: Unfortunately, for events that have already been sent and stored in Mixpanel, there isn't a direct way to remove the location data retroactively. Mixpanel doesn't provide a feature to bulk update or delete properties from existing events.3. User profiles with location data: For user profiles, you can update them to remove the location data. However, you'll need to do this programmatically for each user. You can set the location properties to null or an empty value for each user profile.4. Dropping location properties: If you want to completely stop storing location data for both new and existing events, you can use Mixpanel's Lexicon feature to drop these properties. This will prevent any new data from being stored for these properties, but it won't remove existing data. Here's how you can do it: - Go to Lexicon in your Mixpanel project settings. - Find the location properties (region, mp_country_code, $country_code). - Drop each of these properties.This process is described in the Lexicon documentation.Remember that dropping properties is irreversible and will affect all future data for these properties. Make sure this aligns with your data strategy before proceeding.For the most comprehensive solution, I recommend: 1. Keep setUseIpAddressForGelocation(false) in your Flutter code. 2. Use Lexicon to drop the location properties. 3. Update user profiles programmatically to remove location data if necessary.If you need to completely remove all historical location data, you might need to contact Mixpanel support directly, as there's no self-serve option for bulk deletion of historical data.

    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.
    ·
    ·

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