JavaScript
Method Description
Implemented in tracker with an async call with additional fields. Operation name and input fields can be set up via Maestra framework.
maestra('async', {
operation: '<operation name>',
data: {
customer: {
ids: {
<ID>: '<ID value>',
},
lastName: '<customer last name>',
firstName: '<customer first name>',
middleName: '<customer middle name>',
mobilePhone: '<customer mobile number>',
email: '<customer email>',
password: '<password>',
area: {
ids: {
externalId: '<customer area ID>'
}
},
customFields: {
<custom field>: '<custom field value>',
<custom multi-value field>: [
'<custom field value>',
'<custom field value>'
],
},
subscriptions: [
{
pointOfContact: '<communication channel, email/SMS/etc.>',
topic: '<emailing topic>',
isSubscribed: <subscription status, true/false>,
valueByDefault: <subscription default value, true/false>
}
]
}
}
});
Sample Operations
maestra('async', {
operation: 'Registration',
data: {
customer: {
ids: {
bitrixId: '346257'
},
mobilePhone: '5552368',
fullName: 'John Smith',
email: '[email protected]',
password: 'Qwerty',
customFields: {
city: 'Austin',
b2b: true,
childrenNames: [
'Emma',
'Peter'
]
},
subscriptions: [
{
pointOfContact: 'Sms',
topic: 'SweetsOfLife',
isSubscribed: false,
valueByDefault: true
},
{
pointOfContact: 'Email',
topic: 'NewGossips',
isSubscribed: true,
valueByDefault: true
}
]
}
}
});
maestra('async', {
operation: 'WebSiteLogin',
data: {
customer: {
ids: {
bitrixId: '346257'
},
email: '[email protected]',
mobilePhone: '5552368'
}
}
});
maestra('async', {
operation: 'callback',
data: {
customer: {
mobilePhone: '5552368'
}
}
});
maestra('async', {
operation: 'popup',
data: {
customer: {
email: '[email protected]',
subscriptions: [
{
pointOfContact: 'Email',
isSubscribed: true,
valueByDefault: false
}
]
}
}
});
Updated about 2 months ago