Created
August 1, 2013 22:52
-
-
Save rrecio/6136058 to your computer and use it in GitHub Desktop.
Mixpanel User Identification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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