Skip to content

The Mixpanel dashboard shows a different Distinct ID than what I passed in .identify() function #665

@brunohenriquesk1

Description

@brunohenriquesk1

Our app uses the identify() method right after user login, passing the MongoDB user ID as the identifier. Most of the time, this works as expected. However, sometimes I observe the following behavior:

  • The identify event appears in the Mixpanel dashboard, but it assigns the previous random distinct_id (generated before the user logged in) instead of the MongoDB user ID.

  • This issue occurs more frequently when switching accounts after calling reset() and then calling identify() again after the new user logs in.

Image

When I check the distinctId locally using Mixpanel.mainInstance().distinctId it correctly shows the MongoDB user ID.

Here is it working as expected when I switch to another user

Image

SDK Version: v4.3.1 (latest)

// On login
Mixpanel.mainInstance().identify(distinctId: mongoUserId)

//Check if user id is correct 
Mixpanel.mainInstance().distinctId

// On logout
Mixpanel.mainInstance().reset()

It's pretty much the same issue as this one but on iOS

mixpanel/mixpanel-react-native#207

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions