when using set profile to set the user's email, should I use $email or just email as the variable's name
Hi Zeyad Y., 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 setting a user's email in their profile using Mixpanel, you should use $email
as the variable name, not just "email". This is because $email
is a reserved profile property in Mixpanel.According to the Reserved Properties documentation: > $email | Email | The user's / group's email address. You must set this property if you want to send emails to users via partners receiving cohorts from our Cohort Syncs.Using $email
ensures that Mixpanel recognizes this property correctly for various features, including cohort syncs and displaying the email in the Mixpanel UI.Here are some examples of how to set the email property correctly in different SDKs: In Python: LBKSmp.people_set('sample_distinct_id', { '$email' : 'sam@​[example.com](http://example.com)', }, meta = {'$ignore_time' : True,'$ip' : 0})LBKS
Mixpanel SDKs: PythonIn Swift: LBKSMixpanel.mainInstance().people.set(properties: ["$email":"joe.doe@​[example.com](http://example.com)"])LBKS
Mixpanel SDKs: iOS (Swift)In Ruby: LBKStracker.people.set('sample_distinct_id', { '$email' => 'sam@​[example.com](http://example.com)' }, ip = 0)LBKS
Mixpanel SDKs: RubyAlways use $email
to ensure proper functionality and integration with Mixpanel's features.
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.