Next Commerce
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

  1. The page calls next.exitIntent({...}) after the SDK has initialized.
  2. On desktop, the enhancer listens for mouseout events on <html> with clientY <= 10. Crossing that line fires the popup once.
  3. On mobile (where there is no mouse), the enhancer is disabled by default. Opt in with mobileScrollTrigger: true to fire when the visitor scrolls past 50% of the page instead.
  4. After the popup is dismissed once, it does not fire again in the same session — the dismissal is recorded in sessionStorage.

Two Display Modes

ModeWhen to use
Image modeA single image (a coupon banner, a discount graphic). The whole image is clickable and triggers your action.
Template modeCustom HTML inside a <template> tag. Use action buttons to apply coupons, run a custom function, or close the modal.

On this page