kapa.ai We are trying to add user profile properties $phone, $email and it is not working ?
I can help you with adding user profile properties in Mixpanel. Based on the information provided, you're having trouble setting the $phone
and $email
profile properties. These are reserved profile properties in Mixpanel that have special handling.Here's how to properly set these properties:
Setting Reserved Profile Properties
The $phone
and $email
are reserved profile properties in Mixpanel that are used for specific system features. They're particularly important if you want to use features like Cohort Syncs.For $phone
, note that international numbers need a '+' prefix. Without it, Mixpanel might add a country code based on the $country_code
property, resulting in duplicate country codes.
Implementation Examples
Here are examples of how to set these properties in different SDKs:
JavaScript
mixpanel.identify('USER_ID');
mixpanel.people.set({
'$email': 'jane.doe@​[example.com](http://example.com)',
'$phone': '+5555555555'
});LBKS```LBKS[Mixpanel SDKs: Javascript](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#storing-user-profiles)
iOS (Swift)
Mixpanel.mainInstance().identify(distinctId: "USER_ID")
Mixpanel.mainInstance().people.set(properties: [
"$email": "jane.doe@​[example.com](http://example.com)",
"$phone": "+5555555555"
])LBKS```LBKS[Mixpanel SDKs: iOS (Swift)](https://docs.mixpanel.com/docs/tracking-methods/sdks/swift#storing-user-profiles)
Common Issues to Check:
1. Make sure you're calling identify()
before setting profile properties
2. Verify you're using the correct property names with the $
prefix
3. For phone numbers, ensure you're including the '+' for international numbers
4. Check that your implementation matches the SDK you're usingIf you could share which SDK you're using and your current implementation code, I could provide more specific guidance.
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.