"If I set the identify value of new events in Mixpanel to the email, and change the identify value of existing events from user_id to the email, will I be able to view both existing and new events as a single user's events combined?"
Hi Amanda, C., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
No, you won't be able to view both existing and new events as a single user's events combined by changing the identify
value from user_id
to email. Mixpanel recommends using an ID that is unique to each user and does not change, for example, a database ID. While using an identifier like email may be more convenient, keep in mind that you cannot merge 2 $user_ids
or change a $user_id
, so if the user changes their email, they will count as a separate user [source].Moreover, in the Simplified ID Merge API, when a $user_id
and $device_id
are present in the same event for the first time, a mapping is created to merge the $user_id
and $device_id
values together, forming an identity cluster. Any data sent with a distinct_id
set to any of the values in an ID cluster will be attributed back to the same user in Mixpanel [source].In the Original ID Merge API, the $identify
event is used to link an Anonymous ID and your chosen User ID together. This event is triggered when you call .identify(&lt;user_id&gt;)
using Mixpanel's Web/Mobile SDKs, it sends the $identify
event to your project containing $identified_id
set to the user_id
in the function, and $anon_id
set to the $device_id
of the current user [source].Therefore, changing the identify
value of existing events from user_id
to email won't merge the events under a single user. Instead, it's recommended to use a consistent, unchanging user_id
for each user.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
⤵️ Hint: Mention @kapa.ai in the thread for follow-ups.