Tracking User Information
After you install the SDK to your app, Reteno begins automatically collect such data:
- Information about push message delivery and openings,
- Users’ push tokens,
- Screen view events,
- Statuses of the users’ subscription to push notifications.
Reteno automatically creates user profiles with all these data, so you can immediately start working with new contacts, for example, sending them a mobile campaign.
External User ID
When the user logs in or signs up to your app, you have to define a unique customer identifier that cannot be shared by other contacts. We call it External User Id or just User Id. The system will match all previous data with an external ID as the primary identifier and update the user’s profile.
Read more about system customer identifiers and their matching in the system >
User Attributes
User attributes are attributes you define to describe segments of your user base, such as language preference or geographic location.
Add your custom External User Id and user attributes like phone, email, etc by the following method:
RetenoSDK.SetUserAttributes(string externalUserId, User user);
Note
ExternalUserId must not be null or empty
User model:
{
"UserAttributes":{
"Phone":"string",
"Email":"string",
"FirstName":"string",
"LastName":"string",
"LanguageCode":"string",
"TimeZone":"string",
"Address":{
"Region":"string",
"Town":"string",
"Address":"string",
"Postcode":"string"
},
"Fields":[
{
"Key":"string",
"Value":"string"
},
{
"Key":"string",
"Value":"string"
}
]
},
"subscriptionKeys":[
"string1",
"string2"
],
"groupNamesInclude":[
"string1",
"string2"
],
"groupNamesExclude":[
"string",
"string2"
]
}
Note
key
Custom fields variables. Details >
phone
We use Google's libphonenumber library for phone number validation. Send phone numbers in the E164 format. A request with an invalid phone number will not be transmitted. You can validate phone numbers by the link.
languageCode
Data about language in RFC 5646 format. Primary language subtag in ISO 639-1 format is required. Example: de-AT
timeZone
Item from TZ database. Example:
Europe/Kyiv
The structure of models (all fields are optional):
public class User
{
public UserAttributes UserAttributes { get; set; }
public List<string> SubscriptionKeys { get; set; }
public List<string> GroupNamesInclude { get; set; }
public List<string> GroupNamesExclude { get; set; }
}
public class UserAttributes
{
public string Phone { get; set; }
public string Email { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string LanguageCode { get; set; }
public string TimeZone { get; set; }
public UserAddress Address { get; set; }
public List<Field> Fields { get; set; }
}
public class UserAddress
{
public string Region { get; set; }
public string Town { get; set; }
public string Address { get; set; }
public string Postcode { get; set; }
}
public class Field
{
public string Key { get; set; }
public string Value { get; set; }
}
Anonymous User Attributes
Reteno
SDK allows tracking anonymous user attributes (no externalUserId required)
. To set user attributes without externalUserId use method SetAnonymousUserAttributes(User user)
:
RetenoSDK.SetAnonymousUserAttributes(User user);
Note
You can't provide anonymous user attributes with phone or/and email. For that purpose use
SetUserAttributes()
method with externalUserId