Mixpanel Community Icon

Changing User Distinct IDs to ULIDs Without Losing Historical Data

·
·

how can I change the distinct id of existing users? Right now, the distinct id is a user's username, but I want to change it to ULIDs. But I also don't want to duplicate users or lose their historical data.

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

    Hi Iva Đ., 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
    ·
    ·

    Based on the information provided in the knowledge sources, changing the distinct_id of existing users in Mixpanel is a complex process that requires careful consideration. The distinct_id is a fundamental identifier in Mixpanel's identity management system, and changing it for existing users can potentially lead to data inconsistencies or loss if not done correctly.Unfortunately, the knowledge sources don't provide a direct method for changing the distinct_id of existing users from usernames to ULIDs while preserving historical data. However, I can offer some insights and potential approaches based on the available information: 1. Identity Merging: Mixpanel uses an identity merging system to link different identifiers for the same user. Instead of changing the existing distinct_id, you could consider using the $identify event to link the new ULID-based identifier with the existing username-based identifier. This approach is described in the Identifying Users (Original) documentation.2. Server-side Identity Management: If you're using server-side tracking, you have more control over the identifiers. You could implement a mapping between the existing username-based distinct_ids and the new ULIDs in your backend, and use this mapping when sending events to Mixpanel. This approach is outlined in the Server-side Identity Management section.3. Data Transformation: If you have access to your Mixpanel data in a data warehouse, you might be able to perform a transformation to update the distinct_ids. This is hinted at in the Project Migration guide, although it doesn't specifically address changing distinct_ids.It's important to note that changing distinct_ids for existing users is a significant operation that could potentially affect your historical data and user identity resolution. Before proceeding with any changes, I strongly recommend reaching out to Mixpanel's support team for guidance specific to your use case. They may be able to provide a more tailored solution or advise on best practices for your specific situation.

    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.