Tracking code for triggering a welcome email
Description
To trigger welcome emails, Retail Rocket has a special method that is responsible for sending the desired trigger scenario. Before calling the welcomeSequence method, the user must be subscribed to mailings using the setProfile tracking code.
-
The logic for sending one welcome email for one email must be supported by the store on its side.
-
Retail Rocket will send as many welcome emails as it receives calls to the welcomeSequence tracking code.
-
The minimum delay for sending an email to a single user is 1 minute.
-
Emails in this scenario have no sending restrictions (48 hours). Thus, they can be sent, for example, along with an abandoned view.
<stock_id> - region identifier, can be a string. Must match the region identifier passed in the product database.
Code example
- Without regions
- With regions
<script type = "text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
try {
rrApi.setProfile({
"email": "<user_email>",
"isAgreedToReceiveMarketingMail": true
});
rrApi.welcomeSequence("<user_email>");
} catch (e) {}
})
</script>
<script type = "text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
try {
rrApi.setProfile({
"email": "<user_email>",
"defaultStockId": "<stock identifier>",
"isAgreedToReceiveMarketingMail": true
});
rrApi.welcomeSequence("<user_email>");
} catch (e) {}
})
</script>