davide-scalzo / react-native-mixpanel

A React Native wrapper for Mixpanel tracking
MIT License
455 stars 195 forks source link

Mixpanel Set working on iOS not Android #196

Closed bpfeiffer187 closed 5 years ago

bpfeiffer187 commented 5 years ago

Has anyone ran into an issues with mixpanel.set not working for android but working great for iOS?

Marzdor commented 5 years ago

I am also seeing this issue. I have tried both set and setOnce and never see android devices. The track events are working for android so not sure why set isn't.

kyleclegg commented 5 years ago

Just to be sure, you have Mixpanel people set up correct with identify calls, right?

I ran into something similar where Mixpanel.identify() worked flawlessly for iOS but did not work for Android - the Mixpanel people data was just not there. We spent hours looking into it and ultimately worked around it by adding an extra Mixpanel.set({ 'User ID': userID }) (or make up anything you want) immediately after calling Mixpanel.identify. From there the Mixpanel people data flowed in for Android users. Our suspicion was some sort of timing issue where the extra call ensured that the initializer was getting hit.

Marzdor commented 5 years ago

I thought it might be something like that so I added a Mixpanel.identify() then did a Mixpanel.set({...})and this still was not working so I ended up adding a second Mixpanel.set({...}) and now it is working.

So for not if anyone is having this issue follow this formate to fix it.

Mixpanel.identify();
Mixpanel.set(yourObj);
Mixpanel.set(yourObj);