User Profile¶
User Profile is an additional information of the user which can be something like gender, age, region, language, subscription type, etc.
You can segment the group of users with these profiles when sending push notifications or in-app messages.
Each profile is identified by a unique user ID. We recommend you to set a user ID before setting user profiles. If you do not set a user ID, then the Repro SDK automatically generates an anonymous user ID. But anonymous user ID will be changed when users update or uninstall your app.
Warning
Registered user profile keys and data types can not be changed or deleted after.
There is no upper limit to the number of registered user profile keys. However, the number of user profiles that can be used as analytics filter as well as campaign filters are limited. You can check the number of user profile keys currently being used from Settings > User Profile Settings.
In User Profile Settings, You can change the settings of user profiles that you can use to filter target audience of Campaigns. User Profiles disabled here will not be displayed as candidates for filters when creating campaigns or display Analytics screen.
Once your app reaches the limit of User Profile Keys, all new incoming User Profile Keys will be registered, but will not be shown as candidates for filters until it is enabled from Settings > User Profile Settings.
In User Profile Settings, deactivating user profiles that are being used to filter campaign target users will cause the campaign not to be sent.
Standard User Profile¶
Repro defines user profiles widely used for filtering users as Standard User Profile. Please call the appropriate API when setting Standard User Profiles. Use Custom User Profile when you want to set original user profiles in your application.
Note
A Standard User Profile is not supported by Unity, Cordova and Cocos2d-x at the moment. Please use Custom User Profile instead.
Gender¶
Set the gender of user. The value is available as constants defined by Repro.
// set the gender as "male"
[Repro setUserGender:RPRUserProfileGenderMale];
// set the gender as "female"
[Repro setUserGender:RPRUserProfileGenderFemale];
// set the gender as "other"
[Repro setUserGender:RPRUserProfileGenderOther];
// set the gender as "male"
Repro.setUserProfile(gender: .male)
// set the gender as "female"
Repro.setUserProfile(gender: .female)
// set the gender as "other"
Repro.setUserProfile(gender: .other)
// set the gender as "male"
Repro.setUserGender(UserProfileGender.MALE);
// set the gender as "female"
Repro.setUserGender(UserProfileGender.FEMALE);
// set the gender as "other"
Repro.setUserGender(UserProfileGender.OTHER);
// set the gender as "male"
ReproCpp::setUserGender(ReproCpp::UserProfileGenderMale);
// set the gender as "female"
ReproCpp::setUserGender(ReproCpp::UserProfileGenderFemale);
// set the gender as "other"
ReproCpp::setUserGender(ReproCpp::UserProfileGenderOther);
// Not available for Unity
// Not available for Cordova
Repro.setUserGender(Repro.GENDER_MALE);
// set the gender as "male"
await Repro.setUserGender(UserGender.male);
// set the gender as "female"
await Repro.setUserGender(UserGender.female);
// set the gender as "other"
await Repro.setUserGender(UserGender.other);
When setting up the filter of push notifications or in-app messages, please refer to the table below to specify the string value.
Gender |
Values to specify in filters |
---|---|
Male |
male |
Female |
female |
Other |
other |
Email Address¶
Set the email address of user.
[Repro setUserEmailAddress:@"user@example.com"];
Repro.setUserProfile(emailAddress: "user@exmaple.com")
Repro.setUserEmailAddress("user@exmaple.com");
ReproCpp::setUserEmailAddress("user@exmaple.com");
// Not available for Unity
// Not available for Cordova
Repro.setUserEmailAddress("user@exmaple.com");
await Repro.setUserEmailAddress("user@example.com");
Automatically Recorded Standard User Profiles¶
The following standard user profiles are recorded automatically in each session without having to explicitly call the APIs.
Last Session Date¶
The last day the user used the application is recorded as a date value.
Locale¶
The locale setting of user's device is recorded as a string value. The value is presented in the format like language-script-region
which conforms to IETF language tag. About IETF language tag, please refer to this page.
Note
Because the exact value of locale depends on devices, the same locale may have multiple possible values. For example, the possible values of Japanese locale are
ja
andja-JP
.Consequently, when using locale to setup the filter, please use the
contains
keyword. For example, to specify Japanese locale, please specify by "contains
ja
" in the filter.
Custom User Profile¶
Set any custom profiles that are not defined in the standard user profiles. String is allowed as the key for the profile. Keys starting from ___repro___
cannot be used. Nil or empty string are not allowed, and the maximum key length is 255 characters.
You can set String or Number to property's value.
String¶
Maximum value length is 255 characters.
[Repro setStringUserProfile:@"Developer" forKey:@"Job"];
Repro.setUserProfile(stringValue: "Developer", forKey: "Job")
Repro.setStringUserProfile("Job", "Developer");
ReproCpp::setStringUserProfile("Job", "Developer");
Repro.SetStringUserProfile ("Job", "Developer");
Repro.setStringUserProfile("Job", "Developer");
Repro.setStringUserProfile("Job", "Developer");
await Repro.setStringUserProfile("Job", "Developer");
Integer¶
[Repro setIntUserProfile:25 forKey:@"Age"];
Repro.setUserProfile(integerValue: 25, forKey: "age")
Repro.setIntUserProfile("Age", 25);
ReproCpp::setIntUserProfile("Age", 25);
Repro.SetIntUserProfile ("Age", 25);
Repro.setIntUserProfile("Age", 25);
Repro.setIntUserProfile("Age", 25);
await Repro.setIntUserProfile("Age", 25);
Decimal¶
[Repro setDoubleUserProfile:176.5 forKey:@"Height"];
Repro.setUserProfile(doubleValue: 176.5, forKey: "Height")
Repro.setDoubleUserProfile("Height", 176.5);
ReproCpp::setDoubleUserProfile("Height", 176.5);
Repro.SetDoubleUserProfile ("Height", 176.5);
Repro.setDoubleUserProfile("Height", 176.5);
Repro.setDoubleUserProfile("Height", 176.5);
await Repro.setDoubleUserProfile("Height", 176.5);
Date¶
NSDate* now = [[NSDate alloc] init];
[Repro setDateUserProfile:now forKey:@"LastLogin"];
let now = Date()
Repro.setUserProfile(dateValue: now, forKey: "LastLogin")
Date now = new Date();
Repro.setDateUserProfile("LastLogin", now);
std::time_t now = std::time(0);
ReproCpp::setDateUserProfile("LastLogin", now);
DateTime now = DateTime.Now;
Repro.SetDateUserProfile ("LastLogin", now);
let now = new Date();
Repro.setDateUserProfile("LastLogin", now);
let now = new Date();
Repro.setDateUserProfile("LastLogin", now.toISOString());
final now = DateTime.now();
await Repro.setDateUserProfile("LastLogin", now);