Tracking code for collecting data of an unregistered user
Description
This method should be called to transfer information about a visitor to the Retail Rocket system, for example, an email address, whose unique identifier in the online store system is not yet known.
It can be used on subscription forms, for example, in the footer of a page, or on pop-up windows.
Note: This method is not suitable for unsubscribing previously subscribed users.
<email> - user's email address, optional parameter;
<phone> - user's phone number in E.164 format, optional parameter;
<defaultStockId> - region identifier, string, up to 50 characters. Must match the region identifier passed in the product database, optional 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;
<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
Code Example
<script>
rrApi.setProfile({
"email": "example@gmail.com",
"phone": "+79999999999",
"softLinks": [{name: "bonus card", value: "234234"}],
"defaultStockId": "<stock identifier>",
"customData": {"data1": "value1"},
"isAgreedToReceiveMarketingMail": true
});
</script>