We are new to Mixpanel and have an application where many users have already created an account. Since their credentials are saved, they aren’t required to login but instead are redirected straight to their account. The mixpanel code in our application currently grabs the users email on signup or login and sends it to Mixpanel. Is there a way to manually enter an email in a user’s profile?
Best answer by enague
Eric from Mixpanel Support here - happy to help here!
To answer your question, there is a way to manually enter an email in a user’s profile. To do this, you can use our Engage API as listed in our developer documentation here: https://developer.mixpanel.com/docs/http#section-storing-user-profiles.
You could use the $set function in out HTTP Spec (https://developer.mixpanel.com/docs/http#section-set). This would allow you to set up a call like the one below:
// sets the "Address" and "Birthday"
// properties of user 13793
"Address": "1313 Mockingbird Lane",
Instead of the Address and Birthday like the above call, you would instead set the property $email for the user profile as this is a reserved property for Mixpanel. Meaning we use this email to send out emails to users only if they have this property. More information on reserved properties can be found here: https://help.mixpanel.com/hc/en-us/articles/115004708186#reserved-properties-for-user-profiles.
Also, I’d like to mention a best practice here in regards to setting people properties. We usually encourage setting these properties like email upon sign up or when that information is available. Then, when the user is authenticated and identified in the user journey, you can call mixpanel.people.set() (syntax varies depending on which SDK you are using) to set this and any other properties you would like on the profile. More information on this can be found here: https://help.mixpanel.com/hc/en-us/articles/115004501966#user-profile-properties.
I hope that helps! =)