Track shopping cart changes
Voyado can trigger abandoned cart communication to identified contacts. To enable this communication flow all cart changes for every unique shopping cart should be sent to Voyado.
cart()
Invoke this method for every time the cart has been changed (added/removed cart item or updated quantity) regardless if the user has been identified by the website or not. cart() will generate a http request to the Collect endpoint.
Field | Type | Description |
*cartRef | string | Cart identifier and must be unique for each cart |
cartUrl | string | URL to the cart |
contactId | string | Voyado contact id, cookie "_vaI" will be used as fallback |
*locale | string | Locale for the site where the cart is (example sv-SE). Format according to IETF language tag. Only locales that has a Product Feed assigned in Voyado can trigger an abandoned cart automation |
*items | Array<object> | An array of items added to cart |
*items[].itemId | string | Item Id (SKU in Voyado) |
*items[].quantity | int | Item quantity |
Fields marked with * are mandatory
<!-- Adds two products in cart--> va("cart",{ "cartRef":"354354", "contactId":"afa7625d-2e97-4667-b4c1-ad3b01194bee", "cartUrl":"https://www.store.se/cart?id=354354", "locale":"sv-SE", "items": [{ "itemId": "456436", "quantity": 2, }, { "itemId": "456437", "quantity": 2, }] });
emptyCart()
Invoke this method when the cart has been emptied either by the user manually or when checkout process has been completed. This method is equivalent to invoking cart() with no items. It’s important to invoke emptyCart() after each successful checkout to avoid faulty abandoned cart communications. emptyCart() will generate a http request to the Collect endpoint.
Field | Type | Description |
---|---|---|
*cartRef | string | Cart identifier |
contactId | string | Voyado contact id |
Fields marked with * are mandatory
va("emptyCart",{ "cartRef": "354354"} );
Submitting cart changes via API
Its possible to submit cart changes directly via API instead of implementing our tracking script. If you choose this approach, it is important that you make sure to that you identify contacts that come to ECOM via clicks in email (add “vtid” in “contactId”).
Corresponding functionality is exposed via REST API:s, see API documentation here.
Handling of shopping cart changes
ECOM
Site submit shopping carts either via the tracking script (which is implemented on the ecom site) or to the external Tracking API.
Azure Data Factory
Shopping carts that are not considered abandoned are filtered out; ie. has not been untouched for at least 30 minutes, are empty or haven’t be identified (connected to a contact in Voyado).
The remaining abandoned carts are sent to Voyado.
Voyado
Voyado triggers the correct automation (based on language/locale) if the following conditions are met:
contactId matches a contact in the environment
the cart has been untouched according to the automation configurations (has to be within about 30 minutes)
the locale matches a product feed in Voyado and the set language in the (any) automation
the sku/skus match products in the product feed (commonly “g:id”). If one sku doesn’t match that product won’t be included in the email, if no skus matches products in the feed the automation wont be triggered at all
if configured: no products in the cart has been purchased (receipt sent to Voyado) since the cart was abandoned
Important steps to ensure during implementation
Call “cart ()” regardless of whether the user is anonymous/identified or logged in or not.
All behavioral data can be used to build understanding and insights. A shopping cart belonging to an anonymous user can be linked afterwards when the user is identified.
Call “cart ()” for all updates to the shopping cart, regardless of where or at what stage on the site the update takes place (product page, popup, checkout, etc).
Voyado handles the shopping cart based on its latest change. It is therefore important that all changes to the shopping cart generate a call to “cart ()” and that the data corresponds exactly with the shopping cart is displayed on the site.
“cartRef” must be unique and must not be shared between different baskets or users.
cartRef is the unique identifier for a shopping cart, the same cartRef may not be used for any other shopping carts. A cartRef of a specific shopping cart must not be changed, all updates regarding a shopping cart must have the same cartRef.
Call “emptyCart ()” after each completed purchase with the current “cartRef”.
It is important to always call emptyCart () with the correct cartRef after the purchase is completed. Or else the cart can be deemed as abandoned by Voyado.
Call “cart ()” with a “locale” that has a Product Feed in Voyado.
In order for the products in a cart to be enriched with article data, a Product Feed for the same language needs to be set up in Voyado. An automation with the same language also needs to be active.