Migrating code from MixPanel
Topics
Identifying users and accounts
The identify method in Mixpanel is used to merge together events from multiple environments so your unique events number is accurate and your funnels don’t break.
Since mixpanel.identify
only takes a single argument (a userID) it maps directly to our identify method:
mixpanel.identify("abc123");
The equivalent call in journy.io becomes:
analytics.identify("abc123");
Mixpanel has the idea of Super Properties, which are user traits that get attached to every event that the user does. In Segment you can set Mixpanel Super Properties using our identify method.
Here’s an example:
mixpanel.register({
$gender: "male",
$hairColor: "brown"
});
The equivalent call in journy.io becomes:
People tracking
Mixpanel people tracking is a separate database from event tracking. For that reason there are separate API methods to record data to Mixpanel People.
This method sets people properties in Mixpanel People. In journy.io you will use our identify method to accomplish this.
Here’s an example:
The equivalent call in journy.io becomes:
This also works when you include a userId argument in your identify call.
As you can see journy.io also recognizes special traits like email and name and translates them to key properties that will be treated accordingly.
Account tracking and user association
Mixpanel account tracking is a separate database from event tracking. For that reason there are separate API methods to record data to Mixpanel Accounts.
Here's an example:
The equivalent call in journy.io becomes:
Event tracking on both user and account
Event tracking is Mixpanel’s bread and butter. Adding journy.io event tracking on top of Mixpanel's couldn’t be easier. Our track method maps directly to Mixpanel’s, on top of associating events to both users and accounts.
As such, when e.g. Elon Musk has 3 accounts Twitter, Tesla and SpaceX, you can track an event when he was active in one particular account. The event name is the first argument and the event properties are the second argument.
The equivalent call in journy.io becomes: