Sending shopping cart events using library

The following steps describe how to send cart events in website using library.

Update Cart

Workflow start when Update Cart event happens. This event can be triggered when the subscriber adds the product to the cart or visits products. Then the workflow will wait a specific period of time before sent.

<script>
    sarepush('updateCart', {}, function (response) {
        console.log(response);
    });
</script>

Additionally you can enrich the event with product data that can be used to personalize the message.

<script>
    sarepush('updateCart', {
        product_id: 99
        product_price: "23$"
        product_name: "Green t-shirt"
    }, function (response) {
        console.log(response);
    });
</script>

Complete Cart

You can stop the workflow by send Complete Cart event. Should be done when the subscriber buys products.

<script>
    sarepush('completeCart', {}, function (response) {
        console.log(response);
    });
</script>.
Message personalization

Last updated