UtilitiesExit Intent
Exit Intent
Exit intent shows a popup when the visitor moves their mouse to leave the page. Use it to show a last-chance offer, capture an email, or apply a coupon before the visitor closes the tab.
How It Works
- The page calls
next.exitIntent({...})after the SDK has initialized. - On desktop, the enhancer listens for
mouseoutevents on<html>withclientY <= 10. Crossing that line fires the popup once. - On mobile (where there is no mouse), the enhancer is disabled by default. Opt in with
mobileScrollTrigger: trueto fire when the visitor scrolls past 50% of the page instead. - After the popup is dismissed once, it does not fire again in the same session — the dismissal is recorded in sessionStorage.
Two Display Modes
| Mode | When to use |
|---|---|
| Image mode | A single image (a coupon banner, a discount graphic). The whole image is clickable and triggers your action. |
| Template mode | Custom HTML inside a <template> tag. Use action buttons to apply coupons, run a custom function, or close the modal. |