Core Concepts

Understand how Retake works in 5 minutes. Master these concepts and you'll recover revenue like a pro.

01. The Two Events

Retake's entire system revolves around two simple events. That's it. Master these and you're done.

INTENT
"User wants to buy something"

Fire this when a user shows purchase intent:

  • Added item to cart
  • Visited pricing page
  • Started checkout flow
  • Clicked "Upgrade" button
CONVERSION
"User completed the purchase"

Fire this when the user actually pays:

  • Payment successful
  • Order confirmed
  • Subscription activated

💡 This cancels any pending recovery emails!

INTENT Event
typescript
// Track when user shows purchase intent
await retake.track({
  event: "INTENT",
  type: "cart",           // What kind of intent?
  userId: "user_123",     // Who is this?
  name: "John Doe",       // What is their name?
  email: "[email protected]", // How to reach them?
  value: 149.99,          // How much revenue at stake?
  items: [...]            // What were they buying?
});
CONVERSION Event
typescript
// Track when user completes purchase
await retake.track({
  event: "CONVERSION",
  userId: "user_123",     // Same user from INTENT
  transactionId: "ord_456", // Your order ID
  value: 149.99           // Final purchase amount
});

02. The Recovery Flow

Here's what happens behind the scenes after you send an INTENT event:

INTENT Received

T+0

User shows purchase intent

Timer Starts

T+0 to T+1hr

Wait for conversion (default: 1hr)

Recovery Email

T+1hr

Sent if no conversion

Cart Recovered

T+?

User returns and buys!

What if they convert before the timer?

If you send a CONVERSION event before the timer expires, the recovery email is automatically cancelled. No annoying emails to customers who already bought!

03. Intent Types Explained

The type parameter tells Retake what kind of intent this is. This helps us send the right recovery message.

TypeUse CaseExample ScenarioRecovery Email Tone
cartEcommerce
Shopping cart abandonmentUser added Nike shoes, left site"Your items are selling fast 🔥"
checkoutEcom & SaaS
Payment form abandonmentEntered card details but didn't pay"Was there an issue with payment? 💳"
pricingSaaS
Pricing page drop-offViewed Pro plan, didn't start trial"Have questions about the Pro plan? 💭"
upgradeSaaS
Upgrade abandonmentClicked 'Upgrade', didn't finish"Unlock the full power of [App] ⚡"
trial_expiringSaaS
Trial ending soon3 days left in 14-day trial"Don't lose your data! expire in 3 days ⏳"
payment_failedSaaS
Recurring payment failureCard expired for monthly sub"Action Needed: Payment Failed ⚠️"

04. User ID Strategy

The userId connects INTENT and CONVERSION events. Here's how to handle it:

For Anonymous Visitors
javascript
// Generate a session ID once, reuse it
function getSessionId() {
  let id = localStorage.getItem('retake_sid');
  if (!id) {
    id = 'sess_' + crypto.randomUUID();
    localStorage.setItem('retake_sid', id);
  }
  return id;
}
For Logged-In Users
javascript
// Use your database user ID
const userId = user.id; // "usr_123abc"

// Or use their email as ID
const userId = user.email; // "[email protected]"

Common Mistake

Don't generate a new ID for each event! The same userId must be used for both INTENT and CONVERSION, otherwise we can't match them and recovery won't work.

Ready to implement?