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.

If you want to track the response of user login process extend PJDSDKLoginDelegate protocol, PJDSDKLoginDelegate contains callback methods for onPJDSDKLoginSuccess and onPJDSDKLoginFailure, implement these methods to your definition.

//Example below doesn’t show all attributes.

let user = PJDSDKModel.User()
user.id = "[email protected]"
user.fingerprint = "002ebf12-a125-5ddf-a739-67c3c5d20177"
user.firstName = "John"
user.lastName = "Doe"
user.dob = "1989-12-18"
user.email = "[email protected]"
user.gender = "Prefer not to say"
user.nationality = "USA"
user.meta = ["key01": "val01", "key02": "val02", "key03": "val03"]
let address = PJDSDKModel.Address()
address.addressLines = ["123 ABC St", "Apt 2201"]
address.countryCode = "USA"
address.postalCode = "75252"
user.address = address
PJDSDK.sharedInstance.delegate = self
PJDSDK.sharedInstance.setCurrentUser(user)

Added mandatory class properties in User in v1.7:

let cookies = PJDSDKModel.Cookies(
necessary: true,
preferences: true,
statistics: true,
marketing: true,
doNotSell: true)
let marketing = PJDSDKModel.Marketing(
smsMarketingAllowed: true,
emailMarketingAllowed: true,
mailMarketingAllowed: true,
callMarketingAllowed: true,
pushNotificationMarketingAllowed: true,
doNotSell: true)
let permissions = PJDSDKModel.Permissions(cookies: cookies, marketing: marketing)
let user = PJDSDKModel.User(permissions:permissions)

To Update user attributes, call the following method.

PJDSDK.sharedInstance.updateUser(user)
SyntaxDescription
PJDSDKModel.User-
idString (Required)
first_nameString (Required)
last_nameString (Required)
fingerprintString (UDID Required)
phoneString
nationalityString
secondary_nationalityString
residenceString
phoneCountryCodeString
genderString
dobString (yyyy-mm-dd)
sourceString
sourceIDString
emailString
addressPJDSDKModel.Address
metaString (key/value pairs)
permissionsPJDSDKModel.Permissions
membershipPJDSDKModel.Membership
PJDSDKModel.Address-
addressLinesArray of 3 strings at a maximum
localityString (city, town, village, etc)
adminAreaString (administrative area such as state, province, island, etc.)
subAdminAreaString (county, other governing entity)
postalCodeString (String postal or zip code (Required) if address is submitted)
countryCodeString Name or Code for country (ex: Canada or CA)
latitudeString
longitudeString
PJDSDKModel.Membership-
isSeasonTicketHolderboolean
isSingleGameTicketBuyerboolean
isTicketPackageBuyerboolean
isClubMemberboolean
isLoyaltyProgramMemberboolean

Mandatory Properties

SyntaxDescription
PJDSDKModel.Permissions-
marketingPJDSDKModel.Marketing
cookiesPJDSDKModel.Cookies
doNotTrackBool? (optional, can be nil)
PJDSDKModel.Marketing-
marketingAllowedBool
smsMarketingAllowedBool
emailMarketingAllowedBool
mailMarketingAllowedBool
callMarketingAllowedBool
pushNotificationMarketingAllowedBool
PJDSDKModel.Cookies-
necessaryBool
preferencesBool
statisticsBool
marketingBool
doNotSellBool
custom[String:Bool]? (optional, can be nil)

NOTE :

Last three tables above contain the mandatory properties (mandatory requirement enforced from the v1.7)

If you want to track the response of user login process extend PJDSDKLoginDelegate protocol, PJDSDKLoginDelegate contains callback methods for onPJDSDKLoginSuccess and onPJDSDKLoginFailure, implement these methods to your definition.

Assign your viewcontroller instance to the delegate before your setCurrentUser(:) method like this PJDSDK.sharedInstance.delegate = self