kapa.ai Tell me the entire flow of Original ID merge
Based on the knowledge sources, I can explain the flow of Original ID Merge in Mixpanel.Original ID Merge is one of Mixpanel's identity management systems that supports retroactive identity merging, enabling the connection of multiple anonymous states to an identified state across different devices and platforms.The Original ID Merge flow works through special identity events: 1. Anonymous Tracking: When a user first interacts with your product, they're assigned an anonymous ID (often called a distinct_id). Events are tracked with this anonymous ID.2. Identification: When a user identifies themselves (typically by logging in or signing up), you send an $identify event containing both the anonymous ID and the user ID. This event has specific required properties:
- event: Must be set to "$identify"
- properties.$identified_id: The user's chosen ID
- properties.$anon_id: The original anonymous ID
- properties.token: Your project token
Create Identity shows the API call format:
sh
   curl --request POST \
        --url '[https://api.mixpanel.com/track#create-identity](https://api.mixpanel.com/track#create-identity)' \
        --header 'accept: text/plain' \
        --header 'content-type: application/x-www-form-urlencoded' \
        --data 'data={
         "event": "$identify",
         "properties": {
             "$identified_id": "YOUR_CHOSEN_USER_ID",
             "$anon_id": "ORIGINAL_ANON_ID",
             "token": "YOUR_PROJECT_TOKEN"
         }
   }
   '
   
```LBKSLBKS3. **Multiple User IDs**: Original ID Merge also supports merging multiple user IDs for the same user through special events like `$create_alias` and `$merge`. This allows you to associate multiple identifiers (like email address and phone number) with the same user.LBKS4. **ID Cluster Limitations**: Each user's ID cluster is limited to a maximum of 500 distinct IDs. If this limit is reached, new distinct IDs can no longer be merged into the same cluster, potentially creating duplicate users in Mixpanel.LBKS5. **Retroactive Merging**: When IDs are merged, Mixpanel retroactively updates previous events, which may take up to 24 hours to be fully reflected in all reports.LBKSThe Original ID Merge system is particularly useful when you need to support multiple identified IDs per user or when you have complex identity management requirements that aren't supported by Simplified ID Merge.LBKSIt's worth noting that if you're implementing a system where multiple users share the same device, you should be cautious about using `reset()` calls on logout, as this can contribute to reaching the 500 ID cluster limit more quickly.
How Mixpanel Marketing Analytics unlocks full user journey analysis mentions that ID Merge helps marry post-login identified activity with pre-login anonymous activity, creating a holistic user activity stream.
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.
Let me check the knowledge base for you again. One moment! 📚
Based on the knowledge sources, I can help you understand the difference between $merge and $create_alias for merging identities in Mixpanel.First, it's important to note that both $merge and $create_alias are only useful for projects using the Original ID Merge system. They have no functionality in the Simplified ID Merge system, which uses a different approach with $device_id and $user_id properties instead.For projects using Original ID Merge: - $create_alias: This allows you to add an alias to a distinct ID. The alias becomes a new value that Mixpanel will interpret as the existing value. Each alias can only map to one distinct ID.
Create Alias- $merge: This is a more powerful tool that allows you to merge two distinct IDs together. It's important to note that merging identities is irreversible - you cannot unmerge distinct IDs once they've been merged.
Merge IdentitiesThe better option depends on your specific use case: - If you need to associate a new ID with an existing user and want to continue using the original ID as the primary identifier, $create_alias might be appropriate.- If you need to fully merge two separate user identities into a single identity cluster, $merge would be more appropriate. However, note that $merge events must be sent via the secure import endpoint ([https://api.mixpanel.com/import](https://api.mixpanel.com/import)), which requires your project API secret.LBKSRemember that if you're using or planning to migrate to the Simplified ID Merge system, neither of these methods will work, and you should instead focus on properly implementing the $device_idand$user_id` properties in your events.
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.
Let me check the knowledge base for you again. One moment! 📚
I'll provide a practical example of using $merge for Original ID Merge in Mixpanel.Based on the knowledge sources, the $merge event is specifically for projects using the Original ID Merge system and allows you to merge two distinct IDs together. Here's a practical example: Let's say you have a user who initially used your mobile app with distinct ID "mobile_user_123" and later used your website with distinct ID "web_user_456". You've determined these are the same person and want to merge their identities.To merge these identities using the $merge event, you would need to send a request to Mixpanel's import endpoint: LBKS[ { "event": "$merge", "properties": { "$distinct_ids": ["mobile_user_123", "web_user_456"], "token": "YOUR_PROJECT_TOKEN" } } ]LBKSThis request would be sent to [https://api.mixpanel.com/import](https://api.mixpanel.com/import) which requires authentication with your project's API secret (not the token) for security reasons.Important notes about this operation: 1. The $merge operation is irreversible - once you merge these IDs, you cannot unmerge them Merge Identities.2. The $merge event must be sent to the secure import endpoint protected by your project API secret.3. After merging, any future events sent with either "mobile_user_123" or "web_user_456" as the distinct_id will be attributed to the same user in Mixpanel.4. There is a limit of 500 IDs that can be merged into a single ID cluster in the Original ID Merge system.This approach is particularly useful when you need to connect user activity across different platforms or when you have multiple identifiers for the same user that you want to consolidate.Remember that if you're using the Simplified ID Merge system, you should use the $device_id and $user_id properties instead of the $merge event.
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.
Let me check the knowledge base for you again. One moment! 📚
Based on the knowledge sources provided, I can address your question about identifying anonymous users and merging advertisement IDs with device IDs in Mixpanel.For anonymous users who haven't signed up, Mixpanel's approach depends on which ID management system your project is using:
Simplified ID Merge System
If you're using the Simplified ID Merge system (which is the recommended approach), you should: 1. Track anonymous users with a $device_id property in your events
2. Avoid creating profiles for anonymous users
3. Not attempt to merge advertisement IDs with device IDs for users who haven't signed upThe Simplified ID Merge documentation specifically recommends: >  Avoid creating profiles for anonymous users
Avoid creating profiles for anonymous users. If possible, cache user profile properties update in cookie or local storage and only send them to Mixpanel after the user is identified (ie logged-in state).
Identifying Users (Simplified)With Simplified ID Merge, you can only have one User ID ($user_id) per ID cluster, and this becomes the canonical Distinct ID. Advertisement IDs would not be suitable to use as User IDs for anonymous users.
Original ID Merge System
If you're using the Original ID Merge system, you have more flexibility to merge multiple identifiers. In this case, you could potentially use advertisement IDs as additional identifiers for anonymous users.However, it's important to note that Mixpanel generally recommends against identifying anonymous users: >  ⚠️We recommend against calling .identify() for anonymous visitors to your site.
Managing User Identity
Alternative Approach
Instead of trying to merge advertisement IDs with device IDs for anonymous users, a better approach would be to: 1. Track the advertisement ID as a property on events for anonymous users
2. Wait until the user signs up to establish their identity
3. Then merge their anonymous activity (tracked with $device_id) with their identified activity (tracked with $user_id)This approach aligns better with Mixpanel's recommended best practices for identity management.If you need to anonymize user data while still tracking unique users, Mixpanel suggests: >  If you want to analyze aggregate user behavior without being able to drill down into any particular user, we recommend generating a hash of some unique ID of the user and using that hash as the user's ID when you call the .identify() method in our SDKs.
Protecting User Data
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.
Let me check the knowledge base for you again. One moment! 📚
Based on the knowledge sources, I can explain how device IDs behave when an app is uninstalled in Mixpanel.For iOS apps, the behavior depends on how the device ID is configured: 1. Default behavior (since v3.6.2 for Objective-C and v2.7.7 for Swift): Mixpanel stopped using the IFA (ID for Advertisers) as a distinct_id and instead uses a random UUID that's stored in local storage. When an app is uninstalled, this local storage is cleared, so the device ID will change upon reinstallation.2. Optional IFV configuration: If you specifically configure Mixpanel to use the IFV (identifierForVendor) as the distinct_id:
- For Objective-C: Set MIXPANEL_UNIQUE_DISTINCT_ID=1 in build settings
- For Swift: Set MIXPANEL_UNIQUE_DISTINCT_ID in build settings   With this configuration, the documentation explicitly states:
The IFV will not change when you call reset, but will change upon app uninstalls/reinstalls.
Mixpanel SDKs: iOS (Swift)
Mixpanel SDKs: iOS (Objective-C)For Android and other platforms, the knowledge sources don't explicitly state the behavior upon uninstallation, but since the device ID is typically stored in local storage, it would likely change when the app is uninstalled and reinstalled, as the local storage would be cleared.This is why Mixpanel recommends implementing proper user identification with .identify() when users log in, so you can maintain consistent user tracking across app reinstalls and across multiple devices.
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.



