Tracking code for collecting email addresses
Description
When a user enters his email in the email form at the website, the tracking code rrApi.setEmail should be called. This tracking code must be installed on the registration and checkout page.
Besiaded, this tracker should be installed on the subscription forms and on authorization.
Important
You can only use an email of a person, who clearly expressed his or her desire to receive email messages from your company, including email advertising campaigns.
Multiregionality
If the integration requires the using of regions (stocks), then the ID of the region in which the user is located must additionally be passed to the tracking code.
All code examples are shown on two tabs - with and without regionality support.
Region ID (stock ID)
<stock_id> - Identifier of the stock to which products belong, string. Must match identifier of stock, which is passed in the product database.
Example of a code
<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
try { rrApi.setEmail("<user_email>"); } catch(e) {}
})
</script>
<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
try { rrApi.setEmail("<user_email>",{"stockId": "<stock_id>"}); } catch(e) {}
})
</script>
Additional parameters
To increase the personalization in emailing, additional parameters can be passed to users, which a user can enter in the fields at the website.
You can add such parameters to the tracking code rrApi.setEmail by analogy with the region (stock) parameter.
Example of a code with additional parameters
<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
try { rrApi.setEmail("<user_email>", {"gender": "Male", "age": 21, "birthday": "1983-05-21" }); } catch(e) {}
})
</script>
Reccomended additional parameters
gender - user gender, string;
age - age, number without quotes;
name - user' name, string;
birthday - date of birth, format YYYY-MM-DD, string;
Updated 9 months ago