Mixpanel Community Icon

How to change identity merge API

·
·

How to change identity merge API

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Hi Nainik M., 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

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    To change the Identity Merge API in Mixpanel, you need to follow these steps: 1. For new organizations created from April 2024, the Simplified ID Merge API is the default. However, you can set the default Identity Merge API version for your projects in the Organization Settings.2. For new projects without any data, you can switch the Identity Merge API version in the Project Settings.3. It's important to note that once there is any data in your project, you cannot change the Identity Merge API version.Here's the crucial information from the Identity Merge APIs documentation: > ⚠️You cannot switch between the two APIs if your project already contains data in it.> For new projects without any data in it, you can switch the Identity Merge API version for the project in the Project Settings: > Once there are any data in your project, your Identity API version cannot be changed.If you're considering migrating to the Simplified ID Merge system, you'll need to set up a new Mixpanel project. The process is outlined in the Migrating to Simplified ID Merge documentation: 1. Create a new Mixpanel project in your existing organization. 2. Enable Simplified API in the new project by navigating to Identity Merge setting under the new Project's Settings. 3. Set up the new project by configuring settings, inviting users, creating teams, etc.Remember, you must enable Simplified ID Merge before sending any data to the new project. After setting up the new project, you'll need to update your implementation to use the new project token and adjust your ID management approach to align with the Simplified ID Merge system.

    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.

  • Avatar of Nainik M.
    Nainik M.
    ·
    ·

    in Simplified ID Merge how I am tracking users on Mixpanel. When users are not logged in, they are on our main platform. From there, they are redirected to a subdomain where they log in. However, Mixpanel is tracking them as separate events rather than associating them with the same identity.

  • Avatar of Nainik M.
    Nainik M.
    ·
    ·

    kapa.ai how I am tracking users on Mixpanel. When users are not logged in, they are on our main platform. From there, they are redirected to a subdomain where they log in. However, Mixpanel is tracking them as separate events rather than associating them with the same identity. in Simplified ID Merge

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Let me check the knowledge base for you again. One moment! đź“š

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Based on the information provided in the knowledge sources, I can help you understand how to properly track users across your main platform and subdomain using Mixpanel's Simplified ID Merge system. Here's how you can address this issue: 1. Use $device_id for Anonymous Users: When users are not logged in on your main platform, Mixpanel's client-side SDKs automatically generate a $device_id and attach it to all events. This serves as the anonymous identifier for the user.2. Implement identify() on Login: When users log in on your subdomain, you should call the identify() method with the user's known identifier (e.g., user ID from your database). This sets the $user_id property for subsequent events.3. Include both $device_id and $user_id: To ensure proper identity merging, you need to include both the $device_id (from the anonymous session) and the $user_id (set after login) in at least one event. This triggers the identity merge in Mixpanel.Here's an example of how this should work: LBKS// On your subdomain, after user logs in mixpanel.identify('USER_ID');LBKS// Send an event that includes both $device_id and $user_id mixpanel.track('User Logged In', { '$device_id': 'ANON_ID', // The anonymous ID from the main platform '$user_id': 'USER_ID' // The user's known identifier });LBKSBy implementing this approach, Mixpanel will create an identity cluster that includes both the anonymous $device_id and the authenticated $user_id, associating all events from both the main platform and the subdomain with the same user.To ensure this works correctly across domains, you may need to implement additional steps: 1. Pass the $device_id from your main platform to the subdomain (e.g., as a URL parameter). 2. On the subdomain, retrieve this $device_id and use it when tracking events or calling identify().Remember, in Simplified ID Merge, a single instance of an event containing both $device_id and $user_id is sufficient to trigger identity merging.For more detailed information on implementing Simplified ID Merge, you can refer to the Identifying Users (Simplified) 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.