> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/audience-and-activation/automate/cart-abandonment-automation.md).

# Cart abandonment automation

The wait-then-remind pattern: catch users who did not complete an action, and stop chasing the ones who did.

## Your goal

Bring back users who showed intent and did not follow through - and stop contacting them the moment they do.

## Expected outcome

An active automation that adds users on an intent event, holds them for a few hours, sends a reminder through a custom action to those who have not converted, and removes anyone who converts in the meantime.

## When this is useful

{% hint style="info" %}
**The scenario.** Cadabra Inc is a major online retailer. They noticed that a lot of their users stop browsing after adding items to their carts, and would like to have them complete their purchases.
{% endhint %}

The automation should:

* Add to the automation users who have added an item to their cart.
* **Wait a few hours - say 2** - in case those users complete their order. If they do, they should exit the scenario before the next action.
* Send the remaining users a reminder, or a promotion code, to entice them into completing the order.

## Prerequisites

* Automations enabled on your organisation, and the `UserScenario` schema requirement satisfied. See [Automations reference](/audience-and-activation/automate/automations-reference.md).
* The events you will trigger and exit on being ingested, and their fields carrying `@TreeIndex` in the runtime schema.
* A custom action built for your organisation, for the [Custom action](/audience-and-activation/automate/automations-reference/actions.md#custom-action) node. Your Account manager can help you get started.

## The build

{% stepper %}
{% step %}

### Trigger on the intent event

Choose **React to an event** as the trigger, configured on a `$basket_view` event.

An event trigger, rather than a segment trigger, because the scenario has to act within hours - segment triggers run at the pace of segment computation. See [Triggers](/audience-and-activation/automate/automations-reference/triggers.md).
{% endstep %}

{% step %}

### Wait

Add a **Wait** node configured to **2 hours** - long enough for a genuine purchase to happen, short enough for the reminder to still be relevant.
{% endstep %}

{% step %}

### Add the exit condition

Add an exit condition on a `$transaction_confirmed` event. Because an exit condition is evaluated at any moment regardless of the user's position, a user who buys during the wait leaves before the reminder node is reached.

{% hint style="warning" %}
This node is not optional politeness. Without it, buyers get the reminder, and - because of the [re-entry rule](/audience-and-activation/automate/automations-reference/triggers.md#re-entry) - they also stay parked in the scenario, unable to re-enter it next time they abandon a cart.
{% endhint %}
{% endstep %}

{% step %}

### Send the reminder

Add a **Custom action** node configured to send the reminder.
{% endstep %}

{% step %}

### Test, then activate

Force a user through with the **Test** button and follow the notifications in that user's timeline. Then save and activate. See [Lifecycle, testing & analytics](/audience-and-activation/automate/automations-reference/lifecycle-testing-and-analytics.md).
{% endstep %}
{% endstepper %}

## The same pattern, one step earlier in the funnel

{% hint style="info" %}
**Post-visit reminder.** Cadabra Inc also noticed that many users look at item pages without adding anything to their basket, and want to draw them into the purchase funnel. Same shape, different values:

* Entry triggered by a `$page_view` event.
* Wait node configured to **3 hours** - not too pushy, and long enough to let the user add items themselves.
* Custom action node configured to send a reminder with the products consulted during the last visit.
* Exit condition on a `$transaction_confirmed` event.
  {% endhint %}

The two differ only in the entry event and the wait duration. That is the general form of this pattern:

| Element        | Cart abandonment           | Post-visit                          |
| -------------- | -------------------------- | ----------------------------------- |
| Entry event    | `$basket_view`             | `$page_view`                        |
| Wait           | 2 hours                    | 3 hours                             |
| Exit condition | `$transaction_confirmed`   | `$transaction_confirmed`            |
| Action         | Reminder or promotion code | Reminder listing consulted products |

## Verification

* The test user's timeline shows the entry, the wait, and the reminder.
* Once active, the per-node counters advance. Remember they count **passages, not unique users**.
* The exit condition's detailed stats show users leaving - which is the signal that people are converting during the wait rather than that the scenario is broken.

## Troubleshooting

<table data-search="false"><thead><tr><th width="290">Symptom</th><th>Likely cause</th></tr></thead><tbody><tr><td>Buyers receive the reminder anyway</td><td>The exit condition is missing, or configured on a different event than the one your schema actually records.</td></tr><tr><td>A user who abandoned a second cart never re-enters</td><td>They are still inside the scenario. See <a href="/audience-and-activation/automate/automations-reference/triggers.md#re-entry">Re-entry</a>.</td></tr><tr><td>The trigger query cannot be saved</td><td>A field in it does not carry <code>@TreeIndex</code> in the runtime schema.</td></tr><tr><td>Users are woken late from the wait node</td><td>More than 50,000 users per hour are passing that node. See <a href="/audience-and-activation/automate/automations-reference.md#usage-limits">Usage limits</a>.</td></tr></tbody></table>

## Related pages

<table data-view="cards" data-search="false"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Post-purchase engagement</strong></td><td>The same components, aimed after the conversion rather than before it.</td><td><a href="/audience-and-activation/automate/post-purchase-engagement.md">Post-purchase engagement</a></td></tr><tr><td><strong>Flow control</strong></td><td>Wait and exit conditions in full.</td><td><a href="/audience-and-activation/automate/automations-reference/flow-control.md">Flow control</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/audience-and-activation/automate/cart-abandonment-automation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
