Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Update User Profile

Method Objective

The method updates the user's profile or creates a new profile bound to the user's current device if it was not created earlier.

If you don't have user data, never send bogus data. It'll cause problems in profile handling in the future. For example, don't send a non-existent email, like anonymous@example.com, or an automatically generated email address that doesn't have anything to do with the user's actual email.

Syntax and parameters

 sdk.setProfileData(params) { callback }

NameTypeRequirementDescription
paramsHashMaprequiredObject with request parameters.
callbackfunctionoptionallyCallback Function

Request Parameters

Name

Type

Description

userEmail

string

User Email.

firstNamestringUser First Name.
genderstringUser Gender (m – male, f – female).
userLoyaltyIdstringThe Loyalty Program user ID (loyalty card).
lastNamestringUser Surname.
userPhonestringUser Phone.
birthdaystringUser birthday in the format YYYYY-MM-DD.
agestringUser age (in years).
locationstringThe user's current location from the list of locations in the product feed.
customPropertiesDictionary [string: string]

Dictionary of custom properties. The custom property must be created before it can be used. Located there: Account > Settings > Profile Property

If property creation isn't available in the account, contact PersonaClick support.

Example of use

sdk.setProfileData(
    userEmail: "john.doe@examplemail.com",
    userPhone: "4400114527199",
    userLoyaltyId: "000001234567",
    birthday: "1990-03-11",
    age: "31",
    firstName: "John",
    lastName: "Doe",
    location: "NY",
    gender: "m",
    customProperties: [
        "property1": "value1",
        "property2": "value2",
        "property3": "value3"
    ]
) { (profileDataResp) in
      print("Profile data callback")
}


Get Device ID of Current Profile

Method Objective

The method allows getting the Device ID of the current profile.

Syntax

 sdk.getDeviceID()

Example of use

var deviceId = sdk.getDeviceID()

  • No labels