Hello , i have an event called REFERRAL.SUCCESSFULL it has peoperties like distinct_id:fromUserId, fromUserId, toUserId. ------- so , i want to create a custom event named REFERRAL.JOINED and it should have property distinct_id:toUserId can any one help me so the new event referral joined will have $distinct_id which means it will shouwn in user profile section
Hi Sathya S., 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
Hello! I understand you want to create a custom event named "REFERRAL.JOINED" based on your existing "REFERRAL.SUCCESSFUL" event, with some changes to the properties. While I can provide some guidance, there are a few important points to consider:1. In Mixpanel, the distinct_id
is a special property used to identify unique users Distinct ID. It's not recommended to manually set this to a different value than the actual user identifier.2. If you want to track an event for the user who joined through a referral (the "toUserId"), you should send a separate event for that user, using their actual distinct_id
.3. Custom events in Mixpanel are created by simply sending them with the desired name and properties. There's no need to "create" them in advance.Here's what you could do:1. When a referral is successful, send your existing "REFERRAL.SUCCESSFUL" event as you're currently doing.2. Additionally, send a new "REFERRAL.JOINED" event for the user who joined. This event should be sent with the distinct_id
set to the actual identifier for the "toUserId". Here's a conceptual example of how you might track this new event (note that the exact code would depend on the SDK you're using):LBKS// Track the REFERRAL.JOINED event for the user who joined mixpanel.track("REFERRAL.JOINED", { "distinct_id": toUserId, // This should be the actual distinct_id for this user "referredBy": fromUserId });LBKS
By doing this, the "REFERRAL.JOINED" event will be associated with the correct user profile for the user who joined through the referral.Remember, it's crucial to use consistent distinct_id
values for each user across all their events to ensure accurate user tracking and analysis in Mixpanel Managing User Identity.If you need more specific guidance, please provide information about which SDK or method you're using to send events 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.