mixpanel / mixpanel-react-native

Official React Native Tracking Library for Mixpanel Analytics
https://mixpanel.com
Apache License 2.0
108 stars 48 forks source link

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

Open vishaledkey opened 1 year ago

vishaledkey commented 1 year ago

Our backend sends the User ID in the login API. As soon as we receive the User ID, we’re calling the.identify(userId) function to set the DIstinct ID. But the events that trigger after login shows different Distinct ID on the Mixpanel dashboard. This is very inconsistent behavior and happens mostly on some Android devices. I’m not sure if it has anything to do with the manufacturer or the Android version itself. Also, I’m using both the react-native and Android Mixpanel libraries in my project (both have individual implementations but are identical). FYI, a single user can log in to multiple devices and can use the app simultaneously. I checked this in the documentation, Not exactly sure what is going wrong. https://docs.mixpanel.com/docs/tracking/how-tos/identifying-users#returning-user

Please refer to the below screenshot:

distinct id issue

When I call the below function in the code, I’m seeing the right Distinct ID (that I passed in the .identify() function)

const distinctId = await mixpanel.getDistinctId();
//Vishal: distinctId:::: 366

Library version I’m using:

"version": "2.2.5" //react-native
'com.mixpanel.android:mixpanel-android:7.+' //android
knightmate commented 5 months ago

@vishaledkey @linmic I'm facing the same issue: when my distinct ID has a number at the end, it's not working. For example, meghraj.des123 does not work and the device ID is shown on Mixpanel as the distinct ID. However, meghraj.des123github works fine, meaning it shows the distinct ID as meghraj.des123github.

cuonglt8 commented 2 months ago

I'm also facing the same issue when identifying user with my own id

mrdanielm commented 1 month ago

Also get this issue, just isnt getting set at all

grrrlikestaquitos commented 1 month ago

Thanks for bringing this to light, I was working on setting up a new project and noticed some inconsistencies when I was setting a UUID into the identify function from Mixpanel. However, if I remove the call altogether it will instead generate it's own uuid.