A User profile contains information about the user like email, phone number, name, etc. Contlo creates a user profile for each user that launches your application, regardless of the login status.
There are two types of users:
- Anonymous users: Unidentified users whose profile does not have an email or a phone number. When a new user launches your application, Contlo creates an anonymous profile using their unique FCM token. The profile includes a Mobile Push Subscription that is in a pending state.
- Identified users: These are users with known email or phone number information.
To set up a user profile, follow the steps below:
- Open the file that contains your login class and pass the user information as parameters in the
- To start sending the user details to Contlo, use the
sendUserDatamethod with the following parameters:
ContloAudience()variable that contains the user details.
- Boolean value for defining the isUpdate flag. True updates the primary parameters (Email, phone) of a user. If set to False, the primary parameters remain unchanged and new user is created.
val contloAudience = ContloAudience( userFirstName = "First", userLastName = "Last", userCity = "City", userPhone = "+919999999999", // 10 digits phone number userEmail = "[email protected]", ) Contlo.sendUserData(contloAudience, false)
Email or phone number is a mandatory field for a user profile.
These are the custom properties of a user that accept key-value pairs. Profile properties contain some extra information about the user. You can define these properties using the
HashMap object and define the customProperties as the map variable in the
val customMap = HashMap<String, String>() customMap.put("custom_key", "data") customMap.put("custom_key1", "data_1") val contloAudience = ContloAudience( userFirstName = "First", userLastName = "Last", userCity = "City", userPhone = "+919999999999", // 10 digits phone number userEmail = "[email protected]", customProperties = customMap ) Contlo.sendUserData(contloAudience, false)
If you want to track anonymous users across devices, you can enable tracking of Advertising ID. To set the Advertising ID as a profile property in the contact details under the Audience Section in your Contlo dashboard, follow the steps below:
- Add the following permission in your AndroidManifest.xml file:
You need to explicitly ask your user for their consent to track Advertising ID as per GDPR Compliance Rules.
- To get user consent, use the
sendAdvertisingId()method as shown below:
Contlo.sendAdvertisingId(<consent>) // Here consent is a boolean value
This feature is optional and Contlo will still be able to track the anonymous user in the same device.