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 22 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

personaclick("profile", "set", Object);

Main request properties

Name

Type

Description

email  

string

User Email.

first_namestringUser First Name.
genderstringUser Gender (m – male, f – female).
idnumber/stringStore side user ID.
last_namestringUser Surname.
phonestringUser Phone.

Additional request properties

Name

Type

Description

agenumber

User age (in years).

autoObject arrayList of vehicles. See description below.
birthdaystring

User birthday in the format YYYYY-MM-DD.

bought_somethingbooleanThe user has or hasn't ever bought something in the store.
fb_idstringFacebook User ID.
kidsObject arrayUser's children. See description below.
locationstring

The user's current location from the list of locations in the product feed.

loyalty_bonusesnumberThe current number of store bonuses at the user.
loyalty_bonuses_to_next_levelnumberThe number of store bonuses necessary for the user to reach the next loyalty level.
loyalty_card_locationstringThe location (from the list of locations in the product feed) where the user last used the loyalty card.
loyalty_idstringThe Loyalty Program user ID (loyalty card).
loyalty_statusstringThe user's current status in the loyalty program.
telegram_idstringTelegram User ID.
vk_idstringVKontakte User ID.

The "auto" object properties

Name

Type

Description

brandstring

Vehicle Brand.

modelstringVehicle Model.
vdsstring

Vehicle's VDS/VIN.

The "kids" object properties

Name

Type

Description

genderstringChild's age (m – male, f – female).
birthdaystringChild's birthday in the format YYYY-MM-DD.

Example of use

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"}
    ]
});



Read User Profile

Method Objective

The method returns accumulated (depersonalized) profile data of the current user.

Syntax and parameters

personaclick("profile", "get", Function);

API response

Name

Type

Description

genderstring


childrenObject arraygender: string
birthday: date
age: number
cosmetic_hairObject arraycondition: string
type: string
cosmetic_skinObject arrayproperties: Hash[%w(body hand leg).map {|t| [t, {
type: 'nested',
properties: { type: { type: 'keyword' }, condition: { type: 'keyword' } }
}]}]
cosmetic_perfumeObject arrayproperties: {
aroma: { type: 'nested', dynamic: false, properties: Hash[ML::Perfume::AROMA_TYPES.map {|t| [t, { type: 'short' }] }] },
family: { type: 'nested', dynamic: false, properties: Hash[ML::Perfume::FAMILY_TYPES.map {|t| [t, { type: 'short' }] }] }
}
allergyboolean
fashion_sizesarrayproperties: Hash[ML::Fashion::TYPES.map {|t| [t, {type: 'short'}]}]
compatibilityObject arraybrand: string
model: string
vdsstring
petsObject arrayproperties: { type: { type: 'keyword' }, breed: { type: 'keyword' }, size: { type: 'keyword' }, age: { type: 'keyword' }, score: { type: 'short' } }
jewelryObject arrayproperties: Hash[%w(metal color gem gender).map {|t| [t, { type: 'keyword' }]}].merge(Hash[%w(ring_size bracelet_size chain_size).map {|t| [t, { type: 'float' }]}])
realtyObject arrayproperties: { type: { type: 'keyword' }, space: { type: 'float' } }
income_levelstring


personaclick("profile", "get", function(profile) {
	console.log(profile.gender);
	console.log(profile.fashion.sizes.shoe);
});

  • No labels