---
title: Abandoned cart
description: Abandoned cart - MailPirate Docs
---

# Abandoned cart

Abandoned cart recovery is one of the highest-ROI email journeys in ecommerce. MailPirate includes a ready-made **Abandoned cart** journey plus platform-specific checkout capture: a **WooCommerce plugin** for onsite tracking, and **Shopify checkouts webhooks** for abandoned checkout URLs and line items.

## What you get

1. **Started Checkout** events with line items, totals, and a checkout URL
2. A three-email journey that waits, reminds, follows up, then soft-closes
3. Automatic **exit when they place an order** after enrollment
4. Merge tags for cart HTML and return-to-checkout links
5. Autopilot toggle so you can arm it with your other programs

## Journey design (starter flow)

| Step | Timing | What happens |
|------|--------|----------------|
| Trigger | Immediately | `Started Checkout` (Woo plugin, Shopify checkouts webhooks, or thin pending-order sync) |
| Wait | 1 hour | Give them time to finish on their own |
| Check | - | If they **ordered since enrollment** → exit |
| Email 1 | - | Cart reminder with `{{ cart_html }}` + checkout link |
| Wait | 1 day | |
| Check | - | Ordered since enrollment → exit |
| Email 2 | - | Softer follow-up, same cart snapshot |
| Wait | 2 days | |
| Check | - | Ordered since enrollment → exit |
| Recommend | - | Affinity products when available |
| Email 3 | - | Last look + optional recommendations |

Re-entry is allowed with a short cooldown (3 days) so a new checkout can start a fresh recovery without nagging endlessly.

Goal event: **Placed Order** (for revenue attribution on the flow).

## Merge tags in cart emails

| Tag | Meaning |
|-----|---------|
| `{{ cart_html }}` | HTML table of items (image, name, qty, price) |
| `{{ checkout_url }}` | Link back to checkout |
| `{{ cart_url }}` | Cart page URL when provided |
| `{{ cart_total }}` | Formatted total when provided |
| `{{ recommendations_html }}` | Used on the last email after Recommend |
| `{{ unsubscribe_url }}` / `{{ preferences_url }}` | Required / recommended compliance links |

## Setup (WooCommerce)

### 1. Connect the store in MailPirate

Under **Connectors**, connect WooCommerce so products and orders sync. Orders are how MailPirate knows recovery succeeded.

### 2. Create a Marketing API token

**Settings → API & webhooks → Marketing API token** → create/rotate → copy the plain token once.

### 3. Install the plugin

1. Download: [mailpirate-for-woocommerce.zip](/downloads/mailpirate-for-woocommerce.zip) (also linked from each WooCommerce connection on Connectors)
2. WordPress → Plugins → Add New → Upload
3. Activate **MailPirate for WooCommerce**
4. WooCommerce → **MailPirate**
5. Paste:
   - API base URL (production: `https://app.mailpirate.com/api/v1/marketing`)
   - Marketing API token
   - Store slug (must match MailPirate)
6. Enable tracking (keep **Added to Cart** / **Viewed Product** on unless you have a reason not to)
7. **Test connection** → Save

The same plugin also places **signup forms** via shortcode `[mailpirate_form id="..."]` or the **MailPirate Form** block. Design forms in MailPirate → [Forms](/docs/forms); the plugin only mounts them and loads the embed script once per page.

### What the plugin sends

| Event | When |
|-------|------|
| `Started Checkout` | Known email + non-empty cart (checkout fields, Blocks email, logged-in user, or remembered identity). Includes line items, totals, coupons, and a **cart restore** URL for emails. |
| `Added to Cart` | Optional; when a known shopper adds a product |
| `Viewed Product` | Optional; product pages for known shoppers |

Failed API calls are retried in the background. Identity is remembered in a cookie/session so later cart edits can track without retyping email. MailPirate keeps `Started Checkout` events for about 45 days (long enough for recovery journeys), then prunes older ones so browse/cart history does not grow forever.

**Cart restore links** carry a signed snapshot of line items and coupon codes (about 14 days). Opening the link rebuilds the cart on the shop and sends the shopper to checkout, without depending on a shared server-side cache. Coupons are re-applied when they are still valid.

### 4. Turn on Abandoned cart

1. Open **Autopilot**
2. Enable **Abandoned cart**
3. Set Autopilot to **Armed** and **Save Autopilot**

MailPirate creates the Abandoned cart journey (and other starter journeys) when you save Autopilot if they are not on the store yet. You can also open **Flows → Abandoned cart** and set status to **Active**.

### 5. Verify

1. Add items to cart on the shop
2. Go to checkout and enter a real test email you control
3. In MailPirate **Profiles**, open that person and confirm a **Started Checkout** event with items
4. Wait for the first reminder (about an hour with the default journey), or temporarily shorten waits on a test copy of the flow
5. Complete checkout → the journey should exit on the next check; a **Placed Order** event should appear after order sync

## Setup (Shopify)

### 1. Connect Shopify with checkout scopes

Under **Connectors**, choose Shopify and enter:

- Shop domain (`mystore.myshopify.com`)
- Admin API access token with at least **`read_checkouts`**, plus the usual read scopes for customers, products, and orders
- Optional **API client secret** (improves webhook security; leave blank if you do not have one)

On connect, MailPirate registers checkout and commerce webhooks for abandoned cart and sync.

### 2. What Shopify sends

| Event | When |
|-------|------|
| `Started Checkout` | Shopper starts checkout with a valid email and at least one line item. Includes totals, line items, and a recover-checkout link for emails. Completed checkouts are ignored. |

No storefront plugin is required for Shopify abandoned cart. Optional onsite product/view tracking can use the Marketing Events API later.

### 3. Turn on and verify

Same as WooCommerce steps 4-5: enable **Abandoned cart** under Autopilot, then abandon a Shopify checkout with a test email and confirm the profile event and recover link.

## Without rich checkout capture

Pending / checkout-status orders from connector sync can still emit **Started Checkout**, but they often lack a restore URL and fire later. Prefer the Woo plugin or Shopify checkouts webhooks.

## Autopilot

**Abandoned cart** is an Autopilot program. When enabled (and Autopilot is armed), MailPirate activates the Abandoned cart journey. When disabled, that journey is paused. Consent, suppressions, hourly Autopilot caps, and frequency caps still apply.

## Best practices

- Authenticate your From domain before scaling recovery volume
- Import suppressions if you are migrating
- Keep tone helpful, not fake-urgent
- Prefer the default three-touch cadence; add offers only when your margins support them
- Test with a staff email before arming on production traffic

## Related

- [Flows](/docs/flows)
- [Autopilot](/docs/autopilot)
- [Store connectors](/docs/connectors)
- [Events API](/docs/api/events)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://mailpirate.com/#organization","name":"MailPirate","legalName":"Jure Rožman s.p.","url":"https://mailpirate.com/","logo":{"@type":"ImageObject","@id":"https://mailpirate.com/#logo","url":"https://mailpirate.com/img/logo/mailpirate-logo.svg","contentUrl":"https://mailpirate.com/img/logo/mailpirate-logo.svg"},"image":{"@id":"https://mailpirate.com/#logo"},"description":"MailPirate is email marketing built for ecommerce stores: campaigns, automated journeys, living audiences, store sync, and deliverability control without managing mail servers yourself.","slogan":"Email that sells more for your store.","foundingDate":"2019-01-29","founder":{"@id":"https://mailpirate.com/#person-jure-rozman"},"address":{"@type":"PostalAddress","streetAddress":"Šinkov Turn 24A","addressLocality":"Vodice","postalCode":"1217","addressCountry":"SI"},"email":"info@mailpirate.com","telephone":"+38640504630","vatID":"SI72369213","identifier":[{"@type":"PropertyValue","propertyID":"AJPES registration number","value":"6881475000"}],"contactPoint":{"@type":"ContactPoint","contactType":"customer support","email":"info@mailpirate.com","telephone":"+38640504630","availableLanguage":["English"]},"knowsAbout":[{"@type":"Thing","name":"Email marketing"},{"@type":"Thing","name":"Ecommerce automation"},{"@type":"Thing","name":"Email deliverability"}],"areaServed":["SI","EU","GB","US"],"sameAs":["https://www.linkedin.com/company/mailpirate"]},{"@type":"Person","@id":"https://mailpirate.com/#person-jure-rozman","name":"Jure Rožman","jobTitle":"Founder","worksFor":{"@id":"https://mailpirate.com/#organization"},"description":"Founder of MailPirate. Builds ecommerce email tooling focused on fair billing, automation, and deliverability.","url":"https://mailpirate.com/about-us","sameAs":["https://www.linkedin.com/in/jurerozman/"]},{"@type":"WebSite","@id":"https://mailpirate.com/#website","url":"https://mailpirate.com/","name":"MailPirate","inLanguage":"en","publisher":{"@id":"https://mailpirate.com/#organization"},"about":{"@id":"https://mailpirate.com/#software"}},{"@type":"SoftwareApplication","@id":"https://mailpirate.com/#software","name":"MailPirate","applicationCategory":"BusinessApplication","applicationSubCategory":"Email marketing","operatingSystem":"Web","url":"https://mailpirate.com/","description":"Ecommerce email platform for Shopify and WooCommerce stores: campaigns, flows, segments, intelligence, and dedicated sending with deliverability controls.","publisher":{"@id":"https://mailpirate.com/#organization"},"featureList":["Campaigns and reporting","Automated flows (welcome, cart recovery, win-back)","Segments and lists","Store connectors (Shopify, WooCommerce)","Intelligence (RFM, affinity, send-time, replenishment)","Deliverability scorecard and dedicated sending","Marketing API and embed forms"]}]}
```
