laravel-mixpanel icon indicating copy to clipboard operation
laravel-mixpanel copied to clipboard

Changes for ID Merge

Open aakarim opened this issue 4 years ago • 5 comments

Mixpanel released an update on managing distinct IDs that is opt-in. It looks like, for the most part, there are no issues with updating. With 1 exception:

https://help.mixpanel.com/hc/en-us/articles/360039133851#benefits-of-the-new-system You can no longer control the canonical id for users in Mixpanel

It looks like laravel-mixpanel assigns the user ID as the canonical ID for the user. To make sure our User IDs don't get wiped on the new system I propose that the package sends 'Laravel ID' or 'Database ID' as a property to Mixpanel so we can trace the profiles in Mixpanel back to their Laravel counterparts.

aakarim avatar May 14 '20 13:05 aakarim

@aakarim That's a good idea. Would you be able to submit a PR?

mikebronner avatar May 14 '20 14:05 mikebronner

Sure.

Any suggestions on how to deal with backfilling data?

My proposal is an artisan command: mixpanel:backfill:user-id which submits an update to each user's Mixpanel profile.

aakarim avatar May 17 '20 15:05 aakarim

That also sounds interesting ... but should be a separate PR. Thanks!

mikebronner avatar May 17 '20 15:05 mikebronner

Hello! Mixpanel's new ID merge function allows you to merge pre authentication and after authentication events (even if they have different distinct id) with your package I guess it works fine with that, doesn't it? How does your package handle identity because I saw that once the user is authenticated it uses user_id, what id does it assign to pre-authentication events?
on the other hand, if I need to integrate the JS mixpanel library because there are events that make it easier for my project to handle it with that, how do you suggest handling the identity in conjunction with your package?

pixsolution avatar Jan 20 '21 07:01 pixsolution

Hello @mikebronner @aakarim I did the test of the question I asked and I see that it does not work well, I place a track "home SaludVitale" with js following your steps https://github.com/GeneaLabs/laravel-mixpanel#javascript-events--auto-track in the home page and it comes out fine perfect in live view 1

then as you see there I login (there I understand it works with php with the default event of the package) but within the explore the event that I did before login "home SaludVitale" doesn't associate it with the user...only show Login event 2

why? I have the ID merge enable in my project

pixsolution avatar Jan 20 '21 13:01 pixsolution