Report User Attributes
The SDK can report user attributes after they login.
Report User Attributes
To track the user attributes, when they login, please follow the below format of setting the current user, with the collected attributes.
You need to implement “OnPJDUserLoggedIn” on your activity. This will add 2 methods that will provide you information about successful or failure login.
SDK will keep user’s data unless you explicitly report the following event.
PJDSDK.reportEvent(Context, PJDEvent.LOGGEDOUT, "ScreenName", "category")
This will remove all of the user’s data from the SDK.
PJDSDKUser has Permissions as mandatory(non-nullable) property to create its instance.
//Example below doesn’t show all attributes.
val cookies = Cookies(necessary = true,preferences = true,statistics = true,marketing = true,doNotSell = true)val marketing = Marketing(smsMarketingAllowed = true,emailMarketingAllowed = true,mailMarketingAllowed = true,callMarketingAllowed = true,pushNotificationMarketingAllowed = true,doNotSell = true)val userPermissions = Permissions(cookies = cookies, marketing = marketing)val pjdSDKUser = PJDSDKUser(permissions=userPermissions)pjdSDKUser.first_name= "FirstName"pjdSDKUser.last_name= "LastName"pjdSDKUser.dob = "2010-10-10"val address= Address()address.countryCode = "USA"address.locality = "USA"address.postalCode = "000000"address.latitude = "10.10"address.longitude = "10.10"pjdSDKUser.address = addressval membership = Membership()membership.isClubMember = truepjdSDKUser.membership = membershipval metaMap = HashMap<String, String>()metaMap.put("City", "Dallas")pjdSDKUser.meta = metaMapPJDSDK.setCurrentUser(Context, pjdSDKUser ,this)
To Update user attributes, call the following method.
PJDSDK.updateUser(Context, pjdSDKUser ,this)
Available attributes that could be packaged to be sent to the backend are below.
Syntax | Description |
---|---|
id | String |
first_name | String |
last_name | String |
String | |
phone | String |
nationality | String |
secondary_nationality | String |
residence | String |
phone_country_code | String |
gender | String |
dob | String (yyyy-mm-dd) |
meta | HashMap<String,String> (key/value pairs) |
permissions | Permissions |
address | Address |
membership | Membership |
Address | - |
address_lines | Array of strings |
locality | String (city, town, village, etc) |
admin_area | String (administrative area such as state, province, island, etc.) |
sub_admin_area | String (county, other governing entity) |
postal_code | String (String postal or zip code (Required) if address is submitted) |
countryCode | String Name or Code for country (ex: Canada or CA) |
latitude | String |
longitude | String |
Membership | - |
isSeasonTicketHolder | boolean |
isSingleGameTicketBuyer | boolean |
isTicketPackageBuyer | boolean |
isClubMember | boolean |
isLoyaltyProgramMember | boolean |
Mandatory properties: From v1.7 following are mandatory properties.
Syntax | Description |
---|---|
Permissions | - |
cookies | Cookies |
marketing | Marketing |
doNotTrack | Boolean? (optional) |
Marketing | - |
smsMarketingAllowed | Boolean |
emailMarketingAllowed | Boolean |
mailMarketingAllowed | Boolean |
callMarketingAllowed | Boolean |
pushNotificationMarketingAllowed | Boolean |
doNotSell | Boolean |
Cookies | - |
necessary | Boolean |
preferences | Boolean |
statistics | Boolean |
marketing | Boolean |
doNotSell | Boolean |
custom | HashMap<String,Boolean>? Optional |