Pumpjack Dataworks Analytics SDK

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.id= "[email protected]"
pjdSDKUser.email= "[email protected]"
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 = address
val membership = Membership()
membership.isClubMember = true
pjdSDKUser.membership = membership
val metaMap = HashMap<String, String>()
metaMap.put("City", "Dallas")
pjdSDKUser.meta = metaMap
PJDSDK.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.

SyntaxDescription
idString
first_nameString
last_nameString
emailString
phoneString
nationalityString
secondary_nationalityString
residenceString
phone_country_codeString
genderString
dobString (yyyy-mm-dd)
metaHashMap<String,String> (key/value pairs)
permissionsPermissions
addressAddress
membershipMembership
Address-
address_linesArray of strings
localityString (city, town, village, etc)
admin_areaString (administrative area such as state, province, island, etc.)
sub_admin_areaString (county, other governing entity)
postal_codeString (String postal or zip code (Required) if address is submitted)
countryCodeString Name or Code for country (ex: Canada or CA)
latitudeString
longitudeString
Membership-
isSeasonTicketHolderboolean
isSingleGameTicketBuyerboolean
isTicketPackageBuyerboolean
isClubMemberboolean
isLoyaltyProgramMemberboolean

Mandatory properties: From v1.7 following are mandatory properties.

SyntaxDescription
Permissions-
cookiesCookies
marketingMarketing
doNotTrackBoolean? (optional)
Marketing-
smsMarketingAllowedBoolean
emailMarketingAllowedBoolean
mailMarketingAllowedBoolean
callMarketingAllowedBoolean
pushNotificationMarketingAllowedBoolean
doNotSellBoolean
Cookies-
necessaryBoolean
preferencesBoolean
statisticsBoolean
marketingBoolean
doNotSellBoolean
customHashMap<String,Boolean>? Optional