Search…
E-Commerce Support
How to set up e-commerce view item, add to cart, and purchase interactions via the SDK.
In order to enable Abandoned Cart notifications we must receive information about the specific items a subscriber has viewed, added to cart, and purchased. The following guide explains how to add these user interactions via the JavaScript SDK.
The following steps assume that you are providing an item catalog/feed to our team.
If you will not be providing a product catalog item information can be provided via the inline JavaScript events. Please contact your account manager for more information on this process.

E-Commerce Interactions

There are several interactions you may provide to us to enable functionality like: Abandoned Cart Campaigns, Revenue Attribution, and Product Recommendation Campaigns:
  • Add To Cart: Fire this interaction whenever a user adds an item to their shopping cart.
  • Purchase Event: Fire this interaction after a visitor successfully completes their cart purchase.
  • Update Cart Event: Fire this interaction after a visitor makes a change to their cart.

Add To Cart

Use this interaction to inform us whenever a visitor adds an item to their shopping cart.
Products
Events
1
pushly('add_to_cart', {
2
"products": [
3
{
4
"id": "PRODUCT_ID",
5
"quantity": 1
6
}
7
]
8
});
Copied!
1
pushly('add_to_cart', {
2
"events": [
3
{
4
"id": "EVENT_ID",
5
"quantity": 1
6
}
7
]
8
});
Copied!
You may call add_to_cart as many times as necessary to keep track of all items in a visitor's cart. Abandoned Cart notifications may be sent for any item in a customer's cart that has not been purchased.
After a purchase is made the visitor's cart will be emptied and no notifications for a purchased item will be sent to the visitor.

Purchase

Use this interaction to inform us when a visitor successfully complete's their cart purchase. Providing this interaction will ensure that visitors do not receive notifications for items they have previously purchased. This interaction will also enable revenue attribution.
It is not required to provide the list of purchased items within the purchase payload but can be provided if add to cart interactions are not implemented or to ensure cart contents are up-to-date.
Products
Events
1
pushly('purchase', {
2
"products": [
3
{
4
"id": "PRODUCT_ID",
5
"quantity": 1
6
}
7
],
8
"price_value": "344.33"
9
});
Copied!
1
pushly('purchase', {
2
"events": [
3
{
4
"id": "EVENT_ID",
5
"quantity": 1
6
}
7
],
8
"price_value": "344.33"
9
});
Copied!

Update Cart

This interaction can be used to change the properties on a cart item or remove an item from the visitor's cart.
To remove an item from the cart call the update_cart method with the full current cart information (omitting the removed item):
Products
Events
1
pushly('update_cart', {
2
"products": [
3
{
4
"id": "PRODUCT_ID",
5
"quantity": 3
6
}
7
]
8
});
Copied!
1
pushly('update_cart', {
2
"events": [
3
{
4
"id": "EVENT_ID",
5
"quantity": 3
6
}
7
]
8
});
Copied!
Or if the cart has been completely emptied provide an empty array:
Products
Events
1
pushly('update_cart', {
2
"products": []
3
});
Copied!
1
pushly('update_cart', {
2
"events": []
3
});
Copied!

FAQ

What fields are required?

If you are providing a separate catalog the only required field is the item id.

Do you support server-to-server events instead of providing add to cart and purchase details via the SDK?

Yes, contact your account manager for more information on providing e-commerce events via server-side calls.