Skip to main content

Method for creating a customer card

Regionality Support

If the integration involves the use of regions (stocks), then the tracking code must additionally pass the ID of the region in which the user is located.

All code examples below are provided in two tabs - with and without region support.

Note: This method is not suitable for unsubscribing previously subscribed users.

Parameter Description

<customerId> - string, unique customer identifier, required parameter;

<softLinks> - dictionary, an abstract pointer to a visitor - a pair consisting of an arbitrary string-key and string-value (for example, key - "loyalty card", value - "card_number"), the email address should not be used as a link, optional parameter;

<email> - string, user's email address, optional parameter;

<phone> - string, user's phone number in E.164 format, optional parameter; Examples of phone numbers in a suitable format:

  • 71112223344
  • 81112223344
  • +71112223344
  • +7(111)2223344
  • +7(111)222-33-44
  • +7 (111) 222-33-44
  • +7 (111) 222 33 44
  • +7 111 222 33 44
  • +7-111-222-33-44
  • 8-111-222-33-44
  • 5577999617074
  • 31687224865
  • 56948840030
  • 123456789012345

<defaultStockId> - string, region identifier, string, up to 50 characters. Must match the region identifier passed in the product database, optional parameter;

<customData> - additional user parameters, a dictionary with a string-key and string-value, optional parameter;

<isAgreedToReceiveMarketingMail> - consent to subscription, boolean value, optional parameter; default value is true

<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
try {
rrApi.setCustomer({
"customerId": "customerId",
"email": "email",
"phone": "phone",
"customData": {
customDataName1: "customDataValue1",
customDataName2: "customDataValue2",
},
"softLinks": [{
name: "testLinkName1",
value: "testValue1"
},
{
name: "testLinkName2",
value: "testValue2"
}
]
"isAgreedToReceiveMarketingMail": true
});
} catch (e) {}
})
</script>