Cart Abandonment


Whether you’re an e-commerce company, or a product company, the techniques used for cart abandonment will help you increase completion rates in any flow where you have drop off. One of the most powerful concepts you’ll learn is how to store context on a profile for easy recall and personalization later.

This recipe is slightly technical. We’ll walk through sending cart data to, clearing the cart when someone checks out, setting up rules to trigger a message when a cart has something in it, and personalizing a message with information from their cart data.


  • Your API credentials from your workspace.
  • The ability to update profile data programmatically when items are added and removed from a Person’s cart.


In, you can store two types of information on a Person: attributes and events. A common way people try to do abandoned carts is using events. However, the most flexible way to do it is with attributes and there are few steps:

The Cart

Store the cart data in the Person’s profile

We recommend storing the cart data as an attribute (optionally named, “cart”) in the Person’s profile in You’ll store it as structured data… probably something like:

Cart: {
{"item_name": "Hat", "item_price": "22"},
{"item_name": "Scarf", "item_price": "11"}

Set the “cart” attribute when a person adds or removes items:

For this example, we’re sending the data using cURL via the terminal window. Your developers will use their language of choice to update the Person’s “cart” attribute via our API.

curl  -i    -X
PUT    -H "Content-Type: application/json"    -u
your_site_id:your_api_key    -d '{"cart":[{"item_name": "hat",
"item_price":22},{"item_name": "scarf", "item_price":11}]}'

This structure is an array of hashes. By storing the data this way you can email the Person and merge in data from their “cart” attribute.

Clear the “cart” attribute when the Person checks out

We’ll trigger our abandonment email by detecting that there’s something in the cart. If there’s nothing in the cart i.e. the Person purchased, or otherwise emptied their cart, then we don’t want to send the email.

Cart: ""

Create Your Segment

Create a segment for People who have something in their “cart” attribute.


Then, use this segment as the trigger in a condition-triggered campaign.


People will match this campaign immediately when they add something to the cart. So make sure you add enough time in your Workflow to allow them to complete checkout.

Set up Frequency

On the trigger page, set up your campaign such that People will re-enter for every re-match of the conditions:


Add your delay

You might want to add something like a 45 minute delay and then 1 email, or add several delays and several emails.


Note, if the Person clears the cart and it is empty when we go to send them a message, we will not send the message and they will leave the campaign if your campaign’s exit conditions are set to make People exit when they stop meeting the trigger conditions. This is what prevents them from getting the message if they check out before your delay has passed.

Create your abandonment email

Hi Friend!

Your cart contains:
{% for item in customer.cart %}{{ item.item_name }} - {{ item.item_price }}{% endfor %}

In our simple example, this will render like the email below:


You can use this basic structure to store lots of data as customer attributes and merge in things like a picture of the item in the cart, a link to the item, etc.

Wrap Up

Abandoned carts are a great way to think about any workflow where someone doesn’t complete the steps you were hoping they would. If you have any trouble setting this up, send us an email with a link to what you’re working on in your account.

Copied to clipboard!