Mixpanel Community Icon

Flutter User Profile: Fixing Email Display Issues with Mixpanel Integration

·
·

Our mobile app is written in Flutter. The problem we're having is that the user profile property email field is not displaying correctly, and our hubspot integration to mixpanel says that the email address is missing for users so the hubspot sync isn't working for user profiles. When I tested in Javascript the following is working, i.e. the email in user profile is stored correctly: mixpanel.people.set({ '$email': 'john.doe@example.com', 'Company': 'The Does' }); And our developers said they are storing it with $email property name in Flutter also, but it's not working. Can you give an exmaple of flutter code with correct user profile email property?

  • Avatar of Mattias N.
    Mattias N.
    ·
    ·

    kapa.ai I've removed the PII. Our mobile app is written in Flutter. The problem we're having is that the user profile property email field is not displaying correctly, and our hubspot integration to mixpanel says that the email address is missing for users so the hubspot sync isn't working for user profiles. When I tested in Javascript the following is working, i.e. the email in user profile is stored correctly: mixpanel.people.set({ '$email': 'email address', 'Company': 'The Does' }); And our developers said they are storing it with $email property name in Flutter also, but it's not working. Can you give an exmaple of flutter code with correct user profile email property?

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

    Please stand by Mattias N. as I search the knowledge base. I normally take about 15 seconds or so. đź‘‹

    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
    ·

    Based on the information provided in the knowledge sources, I can help you with an example of how to correctly set the email property for user profiles in Flutter using Mixpanel. The issue you're experiencing is likely due to how the email property is being set in your Flutter code.Here's an example of how to correctly set the email property in Flutter: LBKS// You must call identify to associate the profile update with the user mixpanel.identify("12345");LBKS// Set the email property using the reserved $email property name mixpanel.getPeople().set("\$email", "jane.doe@​[example.com](http://example.com)");LBKS// You can set multiple properties at once if needed mixpanel.getPeople().set({ "\$email": "jane.doe@​[example.com](http://example.com)", "Company": "The Does" });LBKSThis example is based on the information from the Mixpanel SDKs: Flutter documentation.A few important points to note: 1. Make sure you call identify() before setting profile properties. This is crucial for associating the profile update with the correct user.2. The email property should be set using the reserved property name $email. In Flutter, you need to escape the $ sign with a backslash \ when used as a string key.3. You can set the email property individually using set() or as part of a map of properties.4. Ensure that you're actually setting a valid email address and not an empty string or null value.If you're still experiencing issues after implementing this correctly, it might be worth double-checking your Mixpanel initialization and overall implementation. Also, ensure that your Flutter SDK is up to date.If the problem persists, you may want to contact Mixpanel support directly, as there might be an issue specific to your project setup that isn't covered in the general documentation.

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

    kapa.ai The example our developers sent is very similar i.e the've stored it as "\$email" but in Mixpanel I don't see the email address under the username and in the user property it's stored as "email" and not as "Email" as I think it should be. Any other ideas why it's not working?

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

    Based on the information you've provided and the knowledge sources available, there are a few potential reasons why the email address isn't displaying correctly in Mixpanel despite your developers using the correct "$email" property. Let's explore some possibilities: 1. Case sensitivity: Mixpanel uses "email" in the user properties, it's possible that the property is being set without the "email" in the JSON payload.6. Mixpanel project settings: Check your Mixpanel project settings to ensure there are no data filters or transformations that might be affecting the email property.To troubleshoot further: 1. Ask your developers to log the exact code they're using to set the email property and verify it matches the correct format.2. Use Mixpanel's debug mode or logging features to confirm that the email property is being sent correctly from your app.3. Check if other reserved properties like "phone" are displaying correctly in Mixpanel.4. Try setting the email property both individually and as part of a map of properties to see if there's any difference:

    // Or mixpanel.getPeople().set({ "\$email": "user@​[example.com](http://example.com)", "otherProperty": "value" }); ```LBKSLBKSIf none of these suggestions resolve the issue, it may be a problem specific to your Mixpanel project or integration. In that case, I recommend contacting Mixpanel support directly for further assistance, as they can investigate your specific project setup and data flow.

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

    kapa.ai how do I activate the Mixpanel debug mode or logging feature?

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

    To activate the Mixpanel debug mode or logging feature in Flutter, you can use the setLoggingEnabled() method. Here's how you can do it: LBKS// enable debug logs mixpanel.setLoggingEnabled(true);LBKSThis code snippet is taken directly from the Mixpanel SDKs: Flutter documentation.By enabling debug mode, you'll be able to see debug logs in the console, which can help you troubleshoot issues with your Mixpanel implementation, including problems with setting user properties like email addresses.Remember to remove or set this to false before releasing your app to production: LBKS// disable debug logs for production mixpanel.setLoggingEnabled(false);LBKSAfter enabling debug mode, you can run your Flutter project and check the console output in your development environment (like Android Studio or Xcode) for Mixpanel-related logs. These logs can provide valuable information about what data is being sent to Mixpanel and any potential issues with your implementation.For more information about debugging and best practices, you can refer to the Debugging documentation.

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

    kapa.ai is it possible to see logging information in Mixpanel UI, i.e. I would like to check what Mixpanel is receiving, if it's receiving $email or email as the property name

  • 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, it is possible to see logging information and check what Mixpanel is receiving directly in the Mixpanel UI. You can use the "Events" feature in Mixpanel to inspect the raw event data, including properties like email" or "email" as the property name for your user profiles.Additionally, you can use the User Profiles feature in Mixpanel to check if the email property is being set correctly on individual user profiles.If you're still having trouble locating the information you need, you might want to consider using the View Sample Events feature in Insights, which allows you to see the 100 most recent samples of a particular event, including all its properties.Remember, if you've recently made changes to your implementation, it may take some time for the data to appear in Mixpanel's UI. If you don't see the expected data immediately, try checking again after a short delay.Debugging: Validate your data and troubleshoot your implementation Insights: Visualize trends and compositions within your 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.