Abandoned Cart Recovery

Abandoned Cart Recovery

Recover lost sales with an intelligent multi-step email sequence. This skill monitors cart abandonment and automatically sends personalized recovery emails to bring customers back.

Overview

PropertyValue
CategoryEmail Marketing
StatusStable
Version3.0
Triggerscart_abandoned, cart_recovered
Average Recovery Rate10-15%

How It Works

graph TD
A[Customer adds to cart] -->|Leaves site| B{Cart abandoned?}
B -->|No checkout in 30min| C[Trigger: cart_abandoned]
C --> D[Wait 1 hour]
D --> E{Purchased?}
E -->|No| F[Send Email #1]
F --> G[Wait 24 hours]
G --> H{Purchased?}
H -->|No| I[Send Email #2 + Discount]
I --> J[Wait 48 hours]
J --> K{Purchased?}
K -->|No| L[Send Email #3 - Final]
E -->|Yes| M[Stop sequence]
H -->|Yes| M
K -->|Yes| M
L --> N[Mark as lost]

Configuration

Basic Setup

skills:
abandoned-cart:
enabled: true
# Cart abandonment detection
detection:
inactivity_threshold: 30m # Minutes before cart is abandoned
min_cart_value: 25 # Minimum cart value to trigger
exclude_logged_out: false # Include guest carts
# Email sequence
sequence:
- delay: 1h
template_id: 101
subject: "Forgot something?"
- delay: 24h
template_id: 102
subject: "Your cart is waiting"
include_discount: true
discount_percent: 10
- delay: 48h
template_id: 103
subject: "Last chance - items selling fast"
include_discount: true
discount_percent: 15
discount_expiry: 24h
# Stop conditions
stop_on:
- cart_recovered
- order_placed
- unsubscribe

Advanced Configuration

skills:
abandoned-cart:
# Segment-specific timing
timing:
vip_customers:
first_email: 30m
discount_threshold: 0 # Always include discount
new_customers:
first_email: 2h
discount_threshold: 50 # Discount only if cart > $50
repeat_customers:
first_email: 1h
discount_threshold: 100
# A/B testing
ab_testing:
enabled: true
variants:
- name: "urgency"
subject: "Items in your cart are selling fast!"
weight: 50
- name: "friendly"
subject: "Did you forget something?"
weight: 50
# Exclusions
exclude:
- email_domain: ["temp-mail.com", "disposable.com"]
- customer_tag: ["wholesale", "staff"]
- product_category: ["gift-cards"]

Triggers

cart_abandoned

Fires when a cart has been inactive for the configured threshold.

Event Data

Parameter Type Description
cart_id required
string

Unique cart identifier

customer_email required
string

Customer's email address

items required
array

Array of cart items with name, price, quantity, image_url

total required
number

Cart total value

currency optional
string

Currency code (e.g., USD, EUR)

Default: USD
recovery_url required
string

URL to recover the cart

abandoned_at required
datetime

When the cart was abandoned

Example payload:

{
"event": "cart_abandoned",
"timestamp": "2024-01-15T14:30:00Z",
"data": {
"cart_id": "cart_abc123",
"customer_email": "[email protected]",
"items": [
{
"id": "prod_123",
"name": "Premium Headphones",
"price": 199.99,
"quantity": 1,
"image_url": "https://cdn.example.com/headphones.jpg",
"variant": "Black"
},
{
"id": "prod_456",
"name": "Phone Case",
"price": 29.99,
"quantity": 2,
"image_url": "https://cdn.example.com/case.jpg"
}
],
"subtotal": 259.97,
"shipping": 0,
"tax": 20.80,
"total": 280.77,
"currency": "USD",
"recovery_url": "https://store.example.com/cart/recover/abc123",
"abandoned_at": "2024-01-15T14:00:00Z"
}
}

cart_recovered

Fires when a customer returns and completes checkout.

{
"event": "cart_recovered",
"timestamp": "2024-01-15T16:45:00Z",
"data": {
"cart_id": "cart_abc123",
"customer_email": "[email protected]",
"order_id": "order_789",
"recovered_via": "email_1", // Which email triggered recovery
"time_to_recover": "2h15m"
}
}

Email Templates

Template Variables

Use these variables in your Brevo email templates:

VariableDescriptionExample
params.FIRSTNAMECustomer’s first nameJane
params.CART_URLCart recovery URLhttps://…
params.CART_TOTALFormatted cart total$280.77
params.ITEM_COUNTNumber of items3
params.ITEMSJSON array of items[…]
params.DISCOUNT_CODEGenerated discount codeSAVE10-ABC
params.DISCOUNT_PERCENTDiscount percentage10
params.EXPIRY_DATEDiscount expiry dateJan 17, 2024

Email 1 (1 hour): Gentle reminder

  • Subject: “Forgot something, {{ params.FIRSTNAME }}?”
  • Focus: Remind about cart contents
  • No discount yet

Email 2 (24 hours): Add urgency + incentive

  • Subject: “Your cart is waiting + 10% off”
  • Focus: Limited-time discount
  • Include discount code

Email 3 (48 hours): Final push

  • Subject: “Last chance - 15% off expires soon”
  • Focus: Scarcity + stronger discount
  • 24-hour expiry on discount

Code Examples

Enable Abandoned Cart Skill

import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
brevoApiKey: process.env.BREVO_API_KEY
});
await tajo.skills.enable('abandoned-cart', {
detection: {
inactivityThreshold: '30m',
minCartValue: 25
},
sequence: [
{ delay: '1h', templateId: 101 },
{ delay: '24h', templateId: 102, discountPercent: 10 },
{ delay: '48h', templateId: 103, discountPercent: 15 }
]
});

Track Cart Abandonment

// Call this when cart activity is detected
await tajo.events.track('cart_updated', {
cartId: 'cart_abc123',
customerEmail: '[email protected]',
items: cartItems,
total: 280.77
});
// Call this when customer leaves without checkout
// (typically from a beforeunload event or session timeout)
await tajo.events.track('cart_abandoned', {
cartId: 'cart_abc123',
customerEmail: '[email protected]',
items: cartItems,
total: 280.77,
recoveryUrl: 'https://store.example.com/cart/recover/abc123'
});

Generate Discount Codes

// Generate a unique discount code
const discount = await tajo.discounts.create({
type: 'percentage',
value: 10,
expiresIn: '7d',
usageLimit: 1,
prefix: 'SAVE10'
});
// discount.code => "SAVE10-ABC123"

Analytics

Track abandoned cart recovery performance:

MetricDescription
Abandonment Rate% of carts that are abandoned
Recovery Rate% of abandoned carts recovered
Revenue RecoveredTotal revenue from recovered carts
Email Open Rate% of recovery emails opened
Email CTRClick-through rate on recovery emails
Time to RecoveryAverage time from abandonment to purchase
const stats = await tajo.skills.getStats('abandoned-cart', {
period: '30d'
});
console.log(stats);
// {
// abandonmentRate: 68.5,
// recoveryRate: 12.3,
// revenueRecovered: 15420.50,
// emailsSent: 2340,
// emailOpenRate: 45.2,
// emailCtr: 8.7,
// avgTimeToRecovery: '4h32m'
// }

Best Practices

Timing Matters

Send the first email within 1-2 hours of abandonment. Recovery rates drop significantly after 24 hours.

  1. Personalize subject lines - Use the customer’s name and cart contents
  2. Show cart contents - Include product images in the email
  3. Create urgency - Mention low stock or limited-time discounts
  4. Make recovery easy - One-click cart recovery links
  5. Test your sequence - A/B test timing, subject lines, and discounts
  6. Respect unsubscribes - Stop the sequence immediately on unsubscribe

Next Steps

  1. Set up cart tracking on your platform
  2. Create email templates in Brevo
  3. Configure discount codes integration
  4. Monitor performance in the dashboard
AI-assistent

Hej! Fråga mig om dokumentationen.

Börja gratis med Brevo