Skip to content

Instantly share code, notes, and snippets.

@kvermeille
Last active October 13, 2015 17:12
Show Gist options
  • Save kvermeille/8b7660af777912e0602d to your computer and use it in GitHub Desktop.
Save kvermeille/8b7660af777912e0602d to your computer and use it in GitHub Desktop.
Mixpanel Guide
//Installation
https://mixpanel.com/help/reference/android#installing-as
//Track User
mixpanel.identify("13793");
//Regular Event
mixpanel.track("Some Event");
//Event with properties
JSONObject props = new JSONObject();
props.put("Gender", "Female");
props.put("Plan", "Premium");
mixpanel.track("Plan Selected", props);
//Timed Event
mixpanel.timeEvent("Image Upload");
// stop the timer if the imageUpload() method returns true
if(imageUpload()){
mixpanel.track("Image Upload");
}
//Before every mixpanel call track a user, the user's ID is the indentification ID
//A session begins when a user logs into the application
//Javascript
mixpanel.identify('13793');
//iOS
[mixpanel identify:@"13793"];
//Android
mixpanel.identify("13793");
//Installation
https://mixpanel.com/help/reference/ios#installing
//Track User
[mixpanel identify:@"13793"];
//Regular Event
[mixpanel track:@"Profile Image Upload"];
//Event with properties
[mixpanel track:@"signup" properties:@{
@"signup_button": @"test12",
@"User Type": @"Paid"
}];
//Timed event
[mixpanel timeEvent:@"Profile Image Upload"]; // start the timer
[self uploadImageWithSuccessHandler:^{
[mixpanel track:@"Profile Image Upload"]; // send event with elapsed time
}];
//Installation
https://mixpanel.com/help/reference/javascript#installing
//Track User
mixpanel.identify('13793');
//Regular Event
mixpanel.track("Played song");
//Event with properties
mixpanel.track(
"Played song",
{"genre": "hip-hop"}
);
// time an event named "Registered"
mixpanel.time_event("Registered");
//some time later
mixpanel.track("Registered", {"Gender": "Male", "Age": 21});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment