Skip to content

Notifications

The following notification types are supported in the eSales Web API and can easily be sent with the JavaScript library. The examples have instantiated the api object as a variable:

var api = window.esalesAPI({ market: '{market}', clusterId:'{CLUSTER-ID}' });

See also the Notification set-up recommendations.

Click notification

The click notification is sent with a ticket when the visitor clicks on a product or an ad.

api.notify.click("{ticket}");

Non-eSales click notification

The non-eSales click notification is sent when a visitor has clicked a product that is not returned by eSales (i.e. not having a ticket). Instead of a ticket, a product key (and if applicable, a variant key) is sent.

// send with productKey
api.notify.nonEsalesClick({ productKey: '{product_key_1}' });
// send with variantKey
api.notify.nonEsalesClick({ variantKey: '{variant_key_1}'});
// send with both variantKey and productKey
api.notify.nonEsalesClick({ productKey: '{product_key_2}', variantKey: '{variant_key_1}' });

Adding-to-cart notification

The adding-to-cart notification is sent with a ticket when a visitor adds an eSales product to their cart.

api.notify.addToCart('{ticket}');

Non-eSales adding-to-cart notification

The non-esales adding-to-cart notification is sent when a visitor adds a product not returned by eSales (i.e. not having a ticket) to their cart. Instead of a ticket, a product key (and if applicable, a variant key) is sent.

// send with productKey
api.notify.nonEsalesAddTocart({ productKey: '{product_key_1}'});
// send with variantKey
api.notify.nonEsalesAddTocart({ variantKey: '{variant_key_1}'});
// send with both variantKey and productKey
api.notify.nonEsalesAddTocart({ productKey: '{product_key_2}', variantKey: '{variant_key_1}' });

Payment notification

Multiple payment notification methods

All payment notifications are recommended to be made as server side operations by using Secure Payment Notification.

Client side payments must be enabled

Client side payments are disabled by default. Contact Apptus Support if there is a need to make payment notifications as client side operations.

The payment notification is sent when the visitor has placed an order and completed payment.

var payment = api.notify.payment();

payment.add({
    productKey: '{product_key_1}',
    quantity: 2,
    unitSellingPrice: 99.90
});

payment.add({
    productKey:'{product_key_2}',
    variantKey:'{variant_key_1}',
    quantity: 1,
    unitSellingPrice: 150.00
});

payment.add({
    variantKey:'{variant_key_2}',
    quantity: 5,
    unitSellingPrice: 165
});

payment.send();

End session notification

The end session notification is to be sent when the visitor session ends according to the level of personalisation. Visitors may experience strange or irrelevant recommendations if the session-handling is not supporting the selected level of personalisation.

api.notify.end();
×