Next Commerce
UtilitiesExit IntentReference

Events

exit-intent:shown

When: A popup becomes visible. Fires once per trigger.

Payload:

FieldTypeDescription
imageUrlstring (image mode only)URL of the image being shown
templatestring (template mode only)Name of the template being shown

exit-intent:clicked

When: The image is clicked in image mode (when imageClickable: true). Does not fire in template mode — use exit-intent:action instead.

Payload:

FieldTypeDescription
imageUrlstringURL of the clicked image

exit-intent:dismissed

When: The popup is closed without taking action — overlay click, X button on an image popup, or any non-action close path.

Payload:

FieldTypeDescription
imageUrlstring (if image mode)URL of the image
templatestring (if template mode)Name of the template

exit-intent:closed

When: A data-exit-intent-action="close" button is clicked, or the X button on a template popup is clicked.

Payload:

FieldTypeDescription
imageUrlstring (if image mode)URL of the image
templatestring (if template mode)Name of the template

exit-intent:action

When: Any data-exit-intent-action button is clicked in template mode (close, apply-coupon, or custom).

Payload:

FieldTypeDescription
actionstringOne of 'close', 'apply-coupon', 'custom'
couponCodestring (action apply-coupon only)The coupon code that was applied

Listening to Events

window.nextReady.push(() => {
  window.next.on('exit-intent:shown', ({ template }) => {
    gtag('event', 'exit_intent_shown', { template });
  });

  window.next.on('exit-intent:action', ({ action, couponCode }) => {
    if (action === 'apply-coupon') {
      gtag('event', 'exit_intent_coupon', { coupon: couponCode });
    }
  });

  window.next.on('exit-intent:dismissed', () => {
    gtag('event', 'exit_intent_dismissed');
  });
});

Event Reference Summary

EventImage modeTemplate modeTrigger
exit-intent:shownPopup becomes visible
exit-intent:clickedImage is clicked
exit-intent:dismissedClosed without action (overlay click, etc.)
exit-intent:closed✓ (X button only)Explicit close button click
exit-intent:actionAny data-exit-intent-action button click

On this page