Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
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.
Note |
---|
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 |
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("profile", "set", Object); |
Request properties
Name | Type | Description |
---|---|---|
age | number | User age (in years). |
auto | Object array | List of vehicles. See description below. |
birthday | string | User birthday in the format YYYYY-MM-DD. |
bought_something | boolean | The user has or hasn't ever bought something in the store. |
string | User Email. | |
fb_id | string | Facebook User ID. |
first_name | string | User First Name. |
gender | string | User Gender (m – male, f – female). |
id | number/string | Store side user ID. |
kids | Object array | User's children. See description below. |
last_name | string | User Surname. |
location | string | The user's current location from the list of locations in the product feed. |
loyalty_bonuses | number | The current number of store bonuses at the user. |
loyalty_bonuses_to_next_level | number | The number of store bonuses necessary for the user to reach the next loyalty level. |
loyalty_card_location | string | The location (from the list of locations in the product feed) where the user last used the loyalty card. |
loyalty_id | string | The Loyalty Program user ID (loyalty card). |
loyalty_status | string | The user's current status in the loyalty program. |
phone | string | User Phone. |
telegram_id | string | Telegram User ID. |
vk_id | string | VKontakte User ID. |
The "auto" object properties
Name | Type | Description |
---|---|---|
brand | string | Vehicle Brand. |
model | string | Vehicle Model. |
vds | string | Vehicle's VDS/VIN. |
The "kids" object properties
Name | Type | Description |
---|---|---|
gender | string | Child's age (m – male, f – female). |
birthday | string | Child's birthday in the format YYYY-MM-DD. |
Example of use
Code Block | ||
---|---|---|
| ||
personaclick("profile", "set", {
id: 100500,
email: "john.doe@examplemail.com",
phone: "4400114527199",
first_name: "John",
last_name: "Doe",
birthday: "1990-03-11",
age: 31,
gender: "m",
location: "NY",
bought_something: true,
loyalty_id: "000001234567",
loyalty_card_location: "NY",
loyalty_status: "5% discount",
loyalty_bonuses: 1123,
loyalty_bonuses_to_next_level: 1877,
fb_id: "000000000354677",
vk_id: "vk031845",
telegram_id: "0125762968357835",
kids: [
{gender: "m", birthday: "2001-04-12"},
{gender: "f", birthday: "2015-07-28"}
],
auto: [
{brand: "Nissan", model: "Qashqai", vds: "TM7N243E4G0BJG978"}
]
}); |
Add Info about Customer's Kids
A lot of stores from the Baby & Children retail segment have aggregated info about customer's kids (surveys, questionnaires, etc.). This data can also be put to use for a better personalization. To enrich the customer profile with this data, send it in a JSON-objects array.
Code Block |
---|
personaclick('profile', 'set', { "kids": [ {"gender": "m", "birthday": "2015-07-26"}, {"gender": "f", "birthday": "2017-06-05"}, {"gender": "m", "birthday": "2014-03-17"} ] }); |
Read Profile Data from PersonaClick
To improve your sales performance, you are permitted top use information about customers available in PersonaClick database.
Code Block |
---|
personaclick('profile', 'get', function(profile) { // Here you can use properties of profile object console.log(profile.gender); console.log(profile.fashion.sizes.shoe); }); |