Hi there,
I have seen similar questions have been asked before, but none of them provided an answer to what I’m looking for.
So our situation is as follows:
- We just imported contacts from a CSV file and they were successfully added to Mixpanel.
- In that import, there were several duplicated of people using same name but different emails during their initial signup.
- As their emails are unique, I want to merge them together using the Merge API with Postman
- I set up a service account (owner role) for the project, and using Basic Auth in Postman with the credentials provided by Mixpanel
- I make a POST request as follows: https://api.mixpanel.com/import#identity-merge
- I set a raw text content as follows
{
"event": "$merge",
"properties": {
"$distinct_ids": [
"first_id",
"second_id"
],
"token": "my_project_token"
}
} - I send, get a 200 response and simply 0 as the body.
- I go back to Mixpanel, but the two users are not merged.
My question is:
Why doesn’t the above work?
Best answer by mikeyherrman
Hi joergen,
It sounds like you could be running into some of the guardrails on the identify event. It is possible to merge multiple email addresses together but you will probably need to use some of the other merging events (either alias or $merge). You can see the different guardrails for the different ways of merging here. To see what error is occuring, you can view you $identify events in Mixpanel and look for the failure reason and failure description properties on that event.
As to the emails being overwritten, the $email property in Mixpanel is a reserved property with some special functionality and you can only have 1 value there as you mentioned. If you wanted to keep all three emails in a property (in addition to using them as distinct_ids for the user), you could create a list property to store each value or something like that.
Hope this helps!