How it works
- Your site submits every cart change, via the tracking script or the tracking API.
- A cart that still contains products and hasn’t been touched for 30 minutes is treated as abandoned. If it is connected to a contact, it is sent to Engage. All other carts are filtered out.
- Engage enriches the products from the product feed and triggers the automation matching the cart’s locale.
What an abandoned cart automation requires
An abandoned cart automation triggers only when all of these are true:- The cart’s
localematches a product feed in Engage, and an active automation is set to that language. - At least one SKU matches a product in that feed (usually via
g:id). Products that don’t match are left out of the email; if no SKUs match, the automation doesn’t trigger at all. - No product in the cart has been purchased since the cart was marked abandoned - that is, no transaction has reached Engage. This can be overruled in the trigger configuration.
Learn about abandoned cart from a user's perspective
Using the tracking script
Two methods are involved. Both send an HTTP POST to the Collect endpoint.cart() — the cart changed
cart() — the cart changed
Call
cart() every time the cart changes: an item added, an item removed, or a quantity updated. Call it whether or not the visitor has been identified.Adding two products to the cart
string
required
Your reference for this cart. Must be unique per cart and must never change for the life of that cart.
string
required
The locale of the site the cart belongs to, as an IETF language tag such as
sv-SE. Only locales with a product feed assigned in Engage can trigger an abandoned cart automation.array<object>
required
The full current contents of the cart.
string
required
The product identifier, matched against SKU in Engage.
int
required
The number of that item in the cart.
string
A link back to this cart on your site, for use in the abandoned cart email.
string
The Engage contact ID. If omitted, the
_vaI cookie is used as a fallback.emptyCart() — the cart is now empty
emptyCart() — the cart is now empty
Call
emptyCart() when the cart has been emptied, either by the visitor or by a completed checkout. It is equivalent to calling cart() with no items.Calling it after every successful checkout is important — otherwise the cart stays populated in Engage and may trigger an abandoned cart email to someone who has already bought.string
required
The same cart reference used for the cart’s other events. Empty carts still need one.
string
The Engage contact ID. If omitted, the
_vaI cookie is used as a fallback.Using the tracking API
You can submit cart changes directly via the API instead of implementing the tracking script. The API always requires acontactId, so it can only track identified visitors. Anonymous carts can only be tracked with the script. You are also responsible for identifying visitors who arrive from Engage email links yourself, by reading the vtid query parameter and passing it as contactId.
If you use abandoned browse as well as abandoned cart, you must also include a sessionId in every payload. See sessions and sessionId.
You can test the calls from your OpenAPI (Swagger) page:
Read about the Engage API and your OpenAPI page
Rules to follow
- Track anonymous carts too. A cart belonging to an anonymous visitor is still linked to their contact once they are identified.
- Every change means one event. Engage always works from the cart’s latest state, so the data you send must match what the site currently displays. Cart updates can happen in a product page, a popup, a mini-cart or the checkout — all of them need to fire an event.
-
cartRefmust be unique and stable. Never share acartRefbetween carts or visitors, and never change it for an existing cart. Getting this wrong on remove-product and empty-cart events is a common bug. -
Always send a
cartRef, even for empty carts. -
localemust match a product feed. Engage needs a feed for that locale to enrich products with article data, and an active automation using that locale. -
Anything not emptied risks being marked abandoned. If a visitor leaves or buys without your site calling
emptyCart(), an active abandoned cart automation will trigger on that cart.

