How can I use mixpanel in SPA? I want to track some events created by user. When user opens page first time randomly generated ID is given to him. After signing in this action is executed.
mixpanel.alias(data.id);
mixpanel.track('Sign In', {
'Email': response.data.email
});
user.setCurrent(data);
In user.setCurrent function I do this:
mixpanel.identify(data.id);
But in my mixpanel account random ID still given to user? What should I do to prevent this?
Using
mixpanel.identify
doesn't actually change the ID Mixpanel uses:What you can do is to add the ID you use in your database to the Mixpanel Person, just like you do with the email at the moment. Then configure the Mixpanel UI to show that column in your reports.