parcelvoy / platform

Parcelvoy: Open source multi-channel marketing automation platform. Send data-driven emails, sms, push notifications and more!
https://parcelvoy.com
Other
210 stars 31 forks source link

Q: How to "merge" users? #398

Closed mattes3 closed 4 months ago

mattes3 commented 5 months ago

I have several SaaS products where a user may sign up. I want to send identify calls to Parcelvoy when they do that.

Now it might occur that one user signs up for two SaaS products, using the same email address. In this case, I want them to be the same user in Parcelvoy. This is a bit difficult because the user has a different unique ID in the two products.

What would be a good practice here? Should I just use the email address as an id? However, the user might change it. 🤔 I'm a bit stuck here.

pushchris commented 5 months ago

Currently don't have a great solution for this problem. We have an aliasing operation, but you would need to know the previous external ID in order to do it, and in general all it does is modify the external ID to be a new value. If you are actively using multiple identifiers in multiple places you would still need something shared in order to know to keep them linked or how to link them. I suppose you would want to use the email for that?

Looking at how other products do it, taking Mixpanel for example you start with a single initial ID that you can then alias additional IDs to and they are all stored together as additional ways to get data associated to that single user. It has the same problem though of needing to know the initial ID, so you'd need to use their email since that appears to be the only piece of information that is the same across them.

Will look into what is would take to create a hash map of identifiers for users so you could reference multiple, but don't have a solution currently.

mattes3 commented 5 months ago

Oh, I see! In this case, a persistent hash map of identifiers would already be a good product in itself. Should be interesting to any SaaS owner who has more than one product.

mattes3 commented 4 months ago

I am now using a hash of the initial email the user signed up with. When they change their email, the hash won't be changed. This should mostly do the trick.