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
- 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 withitem
- To populate your table with content from the cart contents head to the Content section of the table and insert a dynamic image.
- 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%}
- If you'd like to reference the product title you can use
item.productTitle
in the text portion of your row
- The next step is to preview and ensure you see multiple items for events that contain cartContents. Click preview.
- Click through the events until you find one with a
cartContents
object. Once you find and event withcartContents
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 theevent.items
products which are the items being added to the cart, and one, as above referencing theevent.cartContents.products
which are the items that are in the cart at the time of the event.
Updated 12 months ago