How To Add Cart Contents To Klaviyo Abandoned Cart Emails

Follow this guide to visually display cart contents in your Klaviyo emails when using Elevar’s server-side destination.

Elevar Klaviyo Server Side Event Properties

Elevar's add to cart Klaviyo event comes with an array object called, event.items. This item contains the product/s that are being added to the cart at the time the event is triggered. Your shoppers can also have existing items in their cart prior to the add to cart event. If they do, these items are accessible via the event.cartContents.products. With this, it's possible to reference/display all of the items that were in the users cart at the time the add to cart event took place, in addition to the item that was added to the cart. To take advantage of this we'll leverage the event.cartContents.products array and work through a simple example.

How to access cartContents in Klaviyo

  1. In your Klaviyo Table Settings ensure your table data is set to dynamic and fill in the Row collection field with event.cartContents.products and the Row alias with item
  1. To populate your table with content from the cart contents head to the Content section of the table and insert a dynamic image.
  1. Use logic similar to the following for the dynamic image and click save. Note that the image is stored in the imageUrl property.
  • {% if item.imageUrl %}{{item.imageUrl}}{%else%}{{item.imageUrl|missing_product_image}}{%endif%}
  1. If you'd like to reference the product title you can use item.productTitle in the text portion of your row
  1. The next step is to preview and ensure you see multiple items for events that contain cartContents. Click preview.
  1. Click through the events until you find one with a cartContents object. Once you find and event with cartContents you should see your table populated with all the items in the cart prior to the triggering event.

Notes

  • Remember that not all events will contain the cartContents object because not all users have items in their cart. It's also important to note that these instructions will only work for flows using Elevar events as their base trigger.
  • The cartContents object does not contain the item/s that are being added to the cart to trigger the add to cart event. To show all items in an abandoned cart email you'd need to build 2 tables. Once referencing the event.items products which are the items being added to the cart, and one, as above referencing the event.cartContents.products which are the items that are in the cart at the time of the event.