UtilitiesExit IntentReference
Events
exit-intent:shown
When: A popup becomes visible. Fires once per trigger.
Payload:
| Field | Type | Description |
|---|---|---|
imageUrl | string (image mode only) | URL of the image being shown |
template | string (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:
| Field | Type | Description |
|---|---|---|
imageUrl | string | URL 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:
| Field | Type | Description |
|---|---|---|
imageUrl | string (if image mode) | URL of the image |
template | string (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:
| Field | Type | Description |
|---|---|---|
imageUrl | string (if image mode) | URL of the image |
template | string (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:
| Field | Type | Description |
|---|---|---|
action | string | One of 'close', 'apply-coupon', 'custom' |
couponCode | string (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
| Event | Image mode | Template mode | Trigger |
|---|---|---|---|
exit-intent:shown | ✓ | ✓ | Popup becomes visible |
exit-intent:clicked | ✓ | — | Image is clicked |
exit-intent:dismissed | ✓ | ✓ | Closed without action (overlay click, etc.) |
exit-intent:closed | ✓ (X button only) | ✓ | Explicit close button click |
exit-intent:action | — | ✓ | Any data-exit-intent-action button click |