# Exit intent or abandonment recovery is implemented

- **Pattern:** `ab-001762` (`marketing-conversion.conversion-infrastructure.exit-intent-implementation`)
- **Severity:** low
- **Lifecycle:** active
- **Last modified:** 2026-04-18
- **Canonical URL:** https://auditbuffet.com/patterns/ab-001762
- **License:** CC-BY-4.0 — attribute to AuditBuffet Pattern Catalog (https://auditbuffet.com/patterns/ab-001762)

## Why it matters

The moment a visitor moves their cursor toward the browser tab bar or the address bar is the last measurable window before they leave, and no exit-intent or abandonment-recovery mechanism means that moment passes silently with zero recovery attempt. A lightweight `mouseleave` listener coupled with a discount offer, extended-trial prompt, or content download converts a meaningful slice of would-be bounces into captured emails or delayed conversions at essentially zero engineering cost.

## Severity rationale

Low because exit-intent recovery captures incremental conversions but the baseline funnel functions without it.

## Remediation

Implement a simple `mouseleave` exit-intent hook that fires when the cursor crosses the top viewport edge, paired with a modal offering a discount, extended trial, or content download. Create `hooks/use-exit-intent.ts`:

```tsx
export function useExitIntent(onExit: () => void) {
  useEffect(() => {
    const handleMouseLeave = (e: MouseEvent) => {
      if (e.clientY <= 0) onExit()
    }
    document.addEventListener('mouseleave', handleMouseLeave)
    return () => document.removeEventListener('mouseleave', handleMouseLeave)
  }, [onExit])
}
```

For mobile, pair with a scroll-depth or time-on-page trigger.

## Detection

- **ID:** `exit-intent-implementation`
- **Severity:** `low`
- **What to look for:** Search for exit intent patterns: (1) `mouseleave` event listeners on the `document` element that trigger a modal or offer — this is the classic desktop exit intent pattern; (2) Mobile abandonment patterns — time-on-page delays or scroll-depth triggers for an offer modal; (3) Exit intent libraries in `package.json` (no common standard library name, but check for custom hook files named `useExitIntent`, `useAbandonmentDetection`, etc.); (4) Email capture overlays or modals that appear conditionally.
- **Pass criteria:** Count all abandonment recovery mechanisms (exit intent, scroll triggers, time delays). At least 1 exit intent modal, abandonment recovery flow, or time/scroll-triggered offer is implemented for the primary landing page. Report: "X abandonment recovery mechanisms found."
- **Fail criteria:** No exit intent or abandonment recovery mechanism found.
- **Skip (N/A) when:** Project is a very simple single-page site or is pre-launch. Signal: project_size is `small` and the site has only one or two marketing sections with no established traffic.
- **Detail on fail:** `"No exit intent listener or abandonment recovery mechanism found in any landing page or global component."`.
- **Remediation:** Exit intent captures the last opportunity before a visitor leaves. A simple implementation:

  ```tsx
  // hooks/use-exit-intent.ts
  export function useExitIntent(onExit: () => void) {
    useEffect(() => {
      const handleMouseLeave = (e: MouseEvent) => {
        if (e.clientY <= 0) onExit()
      }
      document.addEventListener('mouseleave', handleMouseLeave)
      return () => document.removeEventListener('mouseleave', handleMouseLeave)
    }, [onExit])
  }
  ```

  Pair with a simple modal offering a discount, extended trial, or content download to recover abandoning visitors.

Taxons: user-experience

HTML version: https://auditbuffet.com/patterns/ab-001762
