I need more info on syncing Mixpanel cohorts with Segment. The identifier sent to Segment, what is used here? Segment uses userID and Mixpanel uses a distinct_id that could be an anonymous ID or the userID we pass with events. How do we ensure the sync takes into account Segments ID resolution?
Hi Bradley A., 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
When syncing Mixpanel cohorts to Segment, Mixpanel uses the distinct_id
from user profiles as the userId
in the Segment identify call. This is explained in the Mixpanel documentation about Segment cohort sync: When a user enters or exits a cohort, Mixpanel sends an identify call to Segment with the following structure: LBKS{ "type": "identify", "traits": { "Mixpanel - <Cohort Name in Mixpanel> ": true, // or false when exiting } "userId": "user@​[email.com](http://email.com)" // Mixpanel uses the distinct_id property here }LBKS
As noted in the documentation, "we use the distinct_id property here" for the Segment userId field Segment Integration.Regarding ID resolution between the two systems, it's important to understand that: 1. Mixpanel's distinct_id could be either an anonymous ID or a user ID depending on whether the user has been identified.2. For cohort syncing to work properly, you should ensure that the distinct_id in Mixpanel matches the userId in Segment for the same user.If you're using Mixpanel's Simplified ID Merge system, you should be aware that the $user_id
property is set as the distinct_id for identified users. This means that when you identify a user in Mixpanel, you should use the same identifier that Segment uses as userId.The documentation doesn't specifically address how to handle Segment's ID resolution in relation to cohort syncing. However, to ensure proper syncing, you should maintain consistent identifiers between both platforms. This typically means using the same user identifier in both systems when identifying users.For a complete implementation of Segment with Mixpanel, you might also want to review the Segment integration documentation which provides details on how to set up the data flow from Segment to Mixpanel.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
but Mixpanel randomly selects the Distinct ID in the cluster as far as I am aware
kapa.ai but Mixpanel randomly selects the Distinct ID in the cluster as far as I am aware
Let me check the knowledge base for you again. One moment! 📚
Your understanding about Mixpanel's distinct_id selection depends on which ID Merge API version your project is using. There are two different systems: 1. For Simplified ID Merge API (default for new organizations since April 2024):
- The distinct_id is not randomly selected but follows clear rules
- When a user has a $user_id
, that value is always set as the distinct_id
- As stated in the documentation: "If an event contains a $user_id
, the value of the $user_id
will be set as the distinct_id
for that event" Identifying Users (Simplified)2. For Original ID Merge API:
- The distinct_id is automatically determined by Mixpanel using one of the IDs in the cluster
- As noted in the documentation: "The distinct_id is automatically determined by Mixpanel using one of the IDs in the cluster and is not user-configurable" Identity Merge APIsFor cohort syncing with Segment specifically, Mixpanel will use whatever the current distinct_id is for each user when sending the identify call to Segment. If you're using the Original ID Merge system, this could indeed be any ID from the cluster.You can check which ID Merge API version your project is using in your project settings.Does your project use the Original or Simplified ID Merge system? This would help clarify exactly how the distinct_id is being determined in your specific case.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
kapa.ai we use the original ID merge
Let me check the knowledge base for you again. One moment! 📚
Thank you for confirming that you're using the Original ID Merge system. This clarifies why you're concerned about the distinct_id selection.With the Original ID Merge system, you're correct that Mixpanel automatically determines which ID in the cluster becomes the distinct_id, and this selection is not user-configurable. As stated in the documentation: "The distinct_id is automatically determined by Mixpanel using one of the IDs in the cluster and is not user-configurable. Any IDs in the cluster can be used for ingestion." Identity Merge APIsFor cohort syncing with Segment, this means that when Mixpanel sends the identify call to Segment, it will use whatever ID has been selected as the distinct_id for that user's cluster. The documentation confirms this behavior: LBKS{ "type": "identify", "traits": { "Mixpanel - <Cohort Name in Mixpanel> ": true, } "userId": "user@​[email.com](http://email.com)" // we use the distinct_id property here }LBKS
Segment IntegrationSince you can't control which ID becomes the distinct_id in the Original ID Merge system, this could potentially cause issues with Segment's ID resolution if the selected distinct_id doesn't match the userId in Segment.Unfortunately, the knowledge sources don't provide specific guidance on how to ensure alignment between Mixpanel's automatically selected distinct_id and Segment's userId in the Original ID Merge system. This is a limitation when using cohort sync with the Original ID Merge system.If this is causing significant issues with your implementation, you might want to consider:
1. Contacting Mixpanel support for specific guidance on this use case
2. For new projects, considering the Simplified ID Merge system which gives you more control over the distinct_idWould you like me to provide any additional information about the Original ID Merge system based on the available documentation?
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.