Skip to content

Instantly share code, notes, and snippets.

@rrecio
Created August 1, 2013 22:52
Show Gist options
  • Save rrecio/6136058 to your computer and use it in GitHub Desktop.
Save rrecio/6136058 to your computer and use it in GitHub Desktop.
Mixpanel User Identification
- (void)identifyMixpanelUser:(User *)user
{
Mixpanel *mixpanel = [Mixpanel sharedInstance];
NSMutableDictionary *properties = [NSMutableDictionary new];
if (user.email) {
[mixpanel identify:user.email];
properties[@"E-mail"] = user.email;
}
if (user.userId) properties[@"User Id"] = user.userId;
if (user.username) properties[@"Username"] = user.username;
if (user.name) properties[@"Name"] = user.name;
if (user.location) properties[@"Location"] = user.location;
if (user.pointsBalance) properties[@"Points Balance"] = user.pointsBalance;
[mixpanel.people set:properties];
NSLog(@"Setting people properties: %@", properties);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment