Table of Contents
Launch Bot On Exit Intent
Updated
by Abby
Here's how to launch a Popup or Livechat bot when the user is trying to leave the page:
We'll insert the following script after our embed script and before the end of the script tag:
function onMouseOut(event) {
// If the mouse is near the top of the window, open the bot
if (event.clientY < 50) {
// Remove this event listener
document.removeEventListener("mouseout", onMouseOut);
// Open the bot
myLandbot.open();
}
}
document.addEventListener("mouseout", onMouseOut);
