Abandoned cart campaign

Send automated emails to customers who leave items in their shopping cart. This guide covers building the scenario, personalizing the email template, and measuring results with A/B testing.

Before you start

This guide assumes you're comfortable navigating and working with basic components in Marketing. If you get stuck, review:

Data and tracking requirements

Track cart_update event

Required attributes:

  • action = add/remove: track this for every change to the shopping cart contents.
  • product_list: contains the current list of items in the cart, plus other values needed to personalize the email. This attribute needs to contain all products in the cart after the last action (add or remove).

Review an example snippet for this attribute.

Track the purchase event

Review an example snippet for this attribute.

Import your product catalog

You need a catalog of your products with an ID for each one. This ID must match the ID collected in your cart_update event. Read more about catalogs.

Integrate your email domain

Review the integrations guide.

Build the scenario

  1. Create a new scenario and add the On event trigger node. This trigger lets customers enter the scenario every time the event fires.
608
  1. Set the event trigger to cart_update with the attribute that contains all the information about items in the cart. This prevents the campaign from sending when the cart is empty.
860
  1. Add these conditions before the A/B split node.
  • Has email and consent: Only customers with an email and corresponding consent should enter the scenario—otherwise your evaluation includes people who aren't eligible to receive emails. Consent logic is specific to your project.

    1112
  • No A/B split last X days: You don't want to send an abandoned cart email to the same customer every time this happens. This condition sets the time range after which a customer can receive another one. Find campaign_id in the URL when the scenario is open.

👍

Pro tip

Check the A/B split instead of whether an email was delivered, to keep the same rules for both the variant and control group. If you only check delivered emails, the control group isn't affected—they don't receive any email. Use a period of at least 7 days.

  • Wait node: Define when to send the email after the customer abandons their cart.
  • Still has consent: Confirm the customer didn't unsubscribe while in the wait node. Use the same consent condition as above.
  • Products in cart and no purchase and very last cart_update: A combined condition — A AND NOT B AND C. See below.

The 3 combined conditions

Products in the cart

An aggregate that checks whether products remain in the cart after the last cart_update. If not, the cart is empty and you don't want to target that customer. The attribute might be called product_list or products. See the aggregate documentation for setup.

🚧

Important

Save this aggregate to your project—you'll need it later to display the cart contents (in product_list) in the email.

No purchase after the last cart_update

Target only customers who haven't completed the order. Create the same aggregate as above, but select last cart_update.timestamp instead of last cart_update.product_list. Create it in Data Manager first, then select it here from the dropdown.

Very last cart_update

Every cart_update event launches this scenario. If the customer changes their cart again later, stop this run and only consider their most recent cart.

🚧

Important

Don't use floor(last(cart_update.timestamp)) for this condition. Flooring the timestamp strips the decimal values, which causes issues when multiple cart updates happen within the same second. This can result in multiple campaigns being enqueued for the same customer.

Use this expression instead: last cart_update.timestamp == event.timestamp. It keeps the full timestamp, including decimals, so only the most recent cart update triggers the campaign—even if several happen within the same second.

Add the A/B test node

Add the A/B test node to measure the revenue uplift the campaign brings.

Add the email node

Attach the email node and insert your email template. See Email templates to build one that shows the products in the cart.

Recommended data for personalization

To show item attributes in your email (image, link, title, price) you need this data available somewhere.

Using Jinja, you can fetch it from either:

  • Your product catalog imported in Bloomreach.
  • The cart_update event's product_list attribute—this only works if your cart_update implementation tracks product_list with the current cart contents on every cart change, regardless of platform or integration. If product_list isn't present or isn't kept up to date, personalization using this method won't work.
ValueUse case
titleShow product name.
imageShow product image.
urlLink to the product.
total_price_local_currencyShow the total cart price in local currency. Useful for free-shipping thresholds.
total_priceShow the total cart price in your reference currency. Useful for calculating revenue across multiple currencies.
priceShow the price of each product.
quantityShow how many units of a product are in the cart.

product_list typically contains only product_id and quantity for each item. To display title, image, url, or price, look up the product by product_id in your imported catalog.

Advanced options

Custom wait time

Send the email when the customer is most likely to be active, based on their last purchase time. Enter this Jinja into a custom wait node:

{{ (((aggregates['592213934d539b19a436c1c2'] / 3600 + 2) % 24) - ((event.timestamp / 3600 + 2) % 24)) if   ((((aggregates['592213934d539b19a436c1c2'] / 3600 + 2) % 24) - ((event.timestamp / 3600 + 2) % 24) -3)>0) else  (((aggregates['592213934d539b19a436c1c2'] / 3600 + 2) % 24) - ((event.timestamp / 3600 + 2) % 24) +21) }}

The referenced aggregate is the last purchase timestamp:

Replace the aggregate ID with the one from your own project.

Add product recommendations

Include personalized recommended products to strengthen the email.

Which products to include depends on your industry, region, and customer segment:

  • Items the customer already viewed.
  • Similar items to what's in their cart that they haven't seen.
  • Other items that might interest them.
  • Complementary products.

What´s next?

How to insert the abandoned products in your email

Did this page help you?

© Bloomreach, Inc. All rights reserved.