Search code examples
mixpanel

How to prevent Mixpanel funnel flow?


I have an app with mixpanel implementation. The funnel flow have three steps but it is not working as it should. The funnel steps is as below:

  • Step 1:User is in landing page.(registered with 'ffgg3434989787334')
  • Step 2:User went to the login page.(registered with 'ffgg3434989787334')
  • Step 3:User successfully logs in and then is redirected to dashboard.(registered with 'user@hotmail.com')

The main problem here is that the events of steps 1 and two are registered with the distinct id generated by the browser(eg. ffgg3434989787334, it is simply random number.But the event for step3 is triggered when the user logs in and it has distinct id same as that of the user so that we can see that event under that user on mixpanel dashboard.Here the funnel flow is broken and that step 3 is not showing in the mixpanel.

Is there any way to register the first two steps to the user that logs in so that funnel flow does not break by the change of disinct id.

I have tried to achieve this with alias and identify but still no luck. The events are distinguished when the user logs in.And also there is no way of registering those events with the user distinct id as we cannot know their id before the user logs in.

Am i implementing mixpanel wrongly or is there some work around for this.Any answers and suggestions are greatly appreciated.Thank you.


Solution

  • Yes, this can be done by using mixpanel alias.You can refer to the link : https://mixpanel.com/docs/integration-libraries/using-mixpanel-alias

    John signs up for your service using his computer. You call mixpanel.alias("john@example.com") and everything goes swimmingly.

    Later, he opens your website on his iPhone using Mobile Safari. This is the first time he's accessed your site from this device, so we assign a brand new distinct_id to him. He clicks around and then logs in. You should not call mixpanel.alias() in this situation - we haven't seen him on this device, but he is not a new user. If you did try to alias, it would attempt to map the email to the random ID we assigned to his phone. That isn't what you want - you want that alias to be associated with the original distinct_id that he has already fired all his events for. In fact, this behavior is so undesirable that if you call alias with an existing alias as the argument, Mixpanel will just silently ignore the alias request.

    Instead of calling mixpanel.alias() you should just call mixpanel.identify(). This will remap his phone activity to the original ID he used when signing up for your service, which is the most desirable outcome. This does mean that regrettably the events he fired before logging in will not be associated with him.