Exit Intent Popup
Recover abandoning visitors. This script tracks mouse movement to detect when a user is about to close the tab or type a new URL, giving you one last chance to convert them.
Move your mouse cursor up towards the browser address bar to see the effect.
Wait! Don't leave yet. Here is a 10% discount code.
Copy the Script
<script>
document.addEventListener("mouseleave", function(e) {
if (e.clientY < 0) {
// User moved mouse above the viewport
alert("Wait! Before you go, check out this offer!");
// Or show a custom modal here
}
});
</script>
Frequently Asked Questions
Exit intent on mobile is harder since there is no 'cursor'. On mobile, you typically trigger this on the 'back' button press or after a significant idle time scroll-up.
Yes. You should combine this with our Cookie-Controlled script to set a flag once the modal has been shown, so it doesn't annoy the user repeatedly.
It can be if overused. Use it sparingly for genuine value (like a discount code) rather than just begging the user to stay.