User Profile

Every time a user downloads/installs the app and opens it for the first time, the installation is tracked and attributed to a new user. This ‘new’ user is a unique user in the Upshot.ai universe but could be an existing user of your application who just switched devices or re-installed the app after deleting it or installed the app after resetting the device.

Every user has a set of attributes that can be tracked/set in the application, one of which is the unique id that the application might generate to identify a user in its system. This ID should be set to the AppuID attribute of External IDs in the SDK. This will help track/group all actions performed by a user across multiple devices attributed to one sameprofile.

Each user profile has one or more named properties that describe that user. Because of rich user data, profiles are excellent for creating audiences to target with personalized messaging.

Upshot.ai sets the following device/app-specific attributes
Device Model
Device OS Version
TimeZone on the device
Network Carrier
TimeZoneDaylight
TimeZoneAbbreviation
IP based location
Latitude (if available)
Longitude (if available)
SystemLocaleCode
BuildVersion
Standard User Profile Attributes.
First Name
Middle Name
Last Name
User Name
Language
E-Mail
Occupation
Qualification
Phone
Gender
Marital Status
Age
Location
LocaleCode
Date Of Birth
emailOptout
smsOptout
pushOptout
dataOptout
ipOptout
External Ids User Profile Attributes:
Facebook ID
Googleplus ID
Twitter ID
Foursquare ID
Linkedin ID
Enterprise UID
Advertising ID
Pinterest ID
AppuID (application register Id)
APNSID (Device Token)
otherExternalIds

GENDER

1 - male
2 - female
3 - other
4 - Reset

MARITAL STATUS

1 - single
2 - engaged
3 - married
4 - widow
4 - widower
5 - divorced
6 - Reset
Custom User Profile Attributes

Upshot.ai defines some standard attributes for each user and also allows you to define application specific custom attributes as part of the user profile. SDK will discard any key which doesn't follow the naming convention.

All the properties or attributes of a User that you wish to capture via BrandKinesis must be passed through the class BKUserInfo.

Example:
  1. Score
  2. Level in the game
  3. Loyalty Points
  4. Status info or badges like "Power user", "Novice user", "Gold Member", etc

NOTE:

Best way of sending user details:

Sample Code:
BKUserInfo *userInfo = [[BKUserInfo alloc] init];
userInfo.email = @"sample@gmail.com";
userInfo.userName = @"userName";
userInfo.phone = @"+919999999999";
userInfo.gender = BKGenderMale;
userInfo.maritalStatus = BKMaritalStatusSingle;

BKExternalId *externalId = [[BKExternalId alloc] init];
externalId.appuID = @"RegistrationId";
userInfo.externalId = externalId;

BKDob *dob = [[BKDob alloc] init];
dob.day = [NSNumber numberWithInteger:1];
dob.month = [NSNumber numberWithInteger:1];
dob.year = [NSNumber numberWithInteger:1990];
userInfo.dateOfBirth = dob;

NSDictionary*others = @{
@"Score" : NSNumber numberWithInteger:100],
@"UserType": @"VIP"
};
userInfo.others = others;

[userInfo buildUserInfoWithCompletionBlock:^(BOOL success, NSError * _Nullable error) {

}];
let userInfo = BKUserInfo()
userInfo.email = "sample@gmail.com"
userInfo.userName = "userName"
userInfo.phone = "+919999999999"
userInfo.gender = .male
userInfo.maritalStatus = .single

let externalId = BKExternalId()
externalId.appuID = "RegistrationId"
userInfo.externalId = externalId
let dob = BKDob()
dob.day = 1
dob.month = 1
dob.year = 1990
userInfo.dateOfBirth = dob

let others = ["Score":100,
"UserType": "VIP"] as [String : Any]
userInfo.others = others

userInfo.build { (status, error) in

}

You can validate userprofile data in Upshot.ai dashboard under Live Events Section:



Logout

Whenever a user logs out, the app should inform to Upshot.ai that the user has logged out.

Sample Code:
BKUserInfo *userInfo = [[BKUserInfo alloc] init];
BKExternalId *externalId = [[BKExternalId alloc] init]; externalId.appuID = @"";
userInfo.externalId = externalId;
[userInfo buildUserInfoWithCompletionBlock:^(BOOL success, NSError * _Nullable error) {

}];
let userInfo = BKUserInfo()
let externalId = BKExternalId()
externalId.appuID = ""
userInfo.externalId = externalId
userInfo.build { (status, error) in

}

Get UserDetails

Upshot.ai provides a method to get current login user details. It accepts arguments as an array and returns dictionary. We can pass list of keys that you want to fetch user details in array. The keys should be upshot.ai provided keys. If key's count is zero then Upshot.ai provides all available user details irrespective of keys

Keys:
userName
lastName
middleName
firstName
email
gender
age
phone
language
sexualOrientation
localeCode
maritalStatus
location
token
appuid
facebookID
twitterID
foursquareID
linkedinID
googleplusID
enterpriseUID
advertisingID
pinterest
year
month
day
Sample Code:
NSArray *keys = @[];
[[BrandKinesis sharedInstance] getUserDetails:keys];
let keys :[String] = []
BrandKinesis.sharedInstance().getUserDetails(keys)

Response: UserDetails response as JSON string

{
"firstName": "Upshot",
"appuid": "",
"others": {
"Key": "Value"
},
"token": ""
}



Get UserId

This method returns the userID/deviceID generated by Upshot.ai

Sample Code:
[[BrandKinesis sharedInstance] getUserId];
BrandKinesis.sharedInstance().getUserId()