davide-scalzo / react-native-mixpanel

A React Native wrapper for Mixpanel tracking
MIT License
455 stars 195 forks source link

Mixpanel.people.set #261

Closed AashJ closed 3 years ago

AashJ commented 3 years ago

What is the alternative for mixpanel.people.set as seen in the node.js documentation (https://developer.mixpanel.com/docs/nodejs)?

My use case is I already have user profiles stored in a database, and am now adding in a mixpanel integration. I want to create user profiles if they don't already exist, but identify otherwise.

eugenetraction commented 3 years ago

If I'm not mistaken this is the syntax:

// Set People properties (warning: if no mixpanel profile has been assigned to the current user when this method is called, it will automatically create a new mixpanel profile and the user will no longer be anonymous in Mixpanel)
Mixpanel.set({"$email": "elvis@email.com"});

// Set People Properties Once (warning: if no mixpanel profile has been assigned to the current user when this method is called, it will automatically create a new mixpanel profile and the user will no longer be anonymous in Mixpanel)
Mixpanel.setOnce({"$email": "elvis@email.com", "Created": new Date().toISOString()});