Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias after login #52

Open
rutgergrasgroen opened this issue Nov 12, 2018 · 9 comments
Open

Alias after login #52

rutgergrasgroen opened this issue Nov 12, 2018 · 9 comments
Assignees

Comments

@rutgergrasgroen
Copy link

Hi,

I dont see any alias happening after i sign up for an account. This means that all the activity that happens before you sign up, wont be mapped to the registered user. Am i correct? Or am i missing something?

If i am right, is it possible to do an alias call on registration? Then we can make a simple Identify after that.
The alias call can only be done once.

Thanks!

Rutger

@mikebronner
Copy link
Owner

Hi @rutgergrasgroen, you are right, there is no alias happening. Do you have any suggestions what we should alias to? There really is no unique identifier if the user hasn't logged in yet, is there?

@rutgergrasgroen
Copy link
Author

Hi Mike,

Thanks for the quick response. The unique id is the distinct id that mixpanel provides for us.

https://help.mixpanel.com/hc/en-us/articles/115004497803-Identity-Management-Best-Practices

This link shows you how to do it. The alias call can only be made once. So i think you have to save the distinct_id to the user database the moment you do the alias call. When the distinct_id is filled, dont call it again. On the link they use the email adres as an unique identifier. But maybe you can use the user_id instead?

@rutgergrasgroen
Copy link
Author

Here i a very clear video explaining the process: https://help.mixpanel.com/hc/en-us/articles/115004510946-Identity-Management-Overview-Video

@rutgergrasgroen
Copy link
Author

@mikebronner Do you know when you have time to implement this feature?

@rutgergrasgroen
Copy link
Author

Nevermind, i fixed it myself. Its very simple to check in blade on auth and then identify. Dito for alias.

@aakarim
Copy link
Contributor

aakarim commented Jan 9, 2019

On my signup 'thank you' page I call:

@if (Auth::check())
          const userId = String({{ \Auth::user()->id }});
          mixpanel.alias(userId);
@endif 

This attaches the user's ID to the Mixpanel distinct_id and ensures that pre-registration Mixpanel actions carry over to the registered user.

@mikebronner
Copy link
Owner

Awesome, thanks @aakarim, I will try to get this implemented soon.

@mischasigtermans
Copy link

@mikebronner what about this issue?

@mikebronner
Copy link
Owner

@mischasigtermans Sorry for the delay on this. I would greatly welcome a PR for this, as I can't promise how soon I can get to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants