Direct Demand Platform for Hotels
Win Direct Bookings before OTAs even see the guest.
Trusted by global travel brands
Exit Intent PopUp (Low - Less Sesitive Detection) (min. 5sec on Page)
// Wrap everything in IIFE to avoid global namespace pollution
// Exit-intent configuration – Change settings below
var SENSITIVITY_LEVEL = ‘low’; // ‘high’, ‘medium’, or ‘low’
var MIN_TIME_ON_PAGE = 3000; // Minimum time before exit-intent activates (milliseconds)
var exitIntentShown0b5ffd8b = false;
var pageLoadTime0b5ffd8b = Date.now();
var lastMouseY0b5ffd8b = 0;
var lastMouseX0b5ffd8b = 0;
var lastMouseTime0b5ffd8b = Date.now();
var mouseMovements0b5ffd8b = [];
var userIdleTime0b5ffd8b = 0;
var lastActivityTime0b5ffd8b = Date.now();
var isUserScrolling0b5ffd8b = false;
var scrollTimeout0b5ffd8b = null;
function showExitIntent0b5ffd8b() {
if (!exitIntentShown0b5ffd8b && (Date.now() – pageLoadTime0b5ffd8b) > MIN_TIME_ON_PAGE) {
document.getElementById(‘modal-0b5ffd8b’).style.display = ‘flex’;
document.body.style.overflow = ‘hidden’;
exitIntentShown0b5ffd8b = true;
}
}
function closeExitIntent0b5ffd8b() {
document.getElementById(‘modal-0b5ffd8b’).style.display = ‘none’;
document.body.style.overflow = ‘auto’;
}
// Enhanced exit-intent detection with improved algorithms
function detectExitIntent0b5ffd8b(e) {
var currentTime = Date.now();
var shouldTrigger = false;
// Update activity tracking
lastActivityTime0b5ffd8b = currentTime;
userIdleTime0b5ffd8b = 0;
// Skip detection if user is scrolling
if (isUserScrolling0b5ffd8b) {
lastMouseY0b5ffd8b = e.clientY;
lastMouseX0b5ffd8b = e.clientX;
lastMouseTime0b5ffd8b = currentTime;
return;
}
var sensitivity = {
‘high’: { threshold: 15, velocity: 8, sideThreshold: 50, acceleration: 2 },
‘medium’: { threshold: 25, velocity: 12, sideThreshold: 80, acceleration: 3 },
‘low’: { threshold: 35, velocity: 18, sideThreshold: 120, acceleration: 4 }
};
var config = sensitivity[SENSITIVITY_LEVEL] || sensitivity[‘medium’];
// Calculate mouse acceleration (change in velocity)
var timeDiff = currentTime – lastMouseTime0b5ffd8b;
var velocityY = timeDiff > 0 ? (lastMouseY0b5ffd8b – e.clientY) / timeDiff : 0;
var velocityX = timeDiff > 0 ? Math.abs(e.clientX – lastMouseX0b5ffd8b) / timeDiff : 0;
// Store movement history for pattern analysis
mouseMovements0b5ffd8b.push({
x: e.clientX,
y: e.clientY,
time: currentTime,
velocityY: velocityY,
velocityX: velocityX
});
// Keep only last 10 movements for analysis
if (mouseMovements0b5ffd8b.length > 10) {
mouseMovements0b5ffd8b.shift();
}
// 1. Detect rapid upward mouse movement with acceleration
if (e.clientY config.velocity) {
// Check if movement is accelerating (stronger intent)
if (velocityY > config.acceleration * config.velocity) {
shouldTrigger = true;
}
}
// 2. Detect mouse leaving viewport at the top
if (e.clientY config.velocity;
for (var j = 0; j < recent.length; j++) {
if (recent[j].velocityY \n\n[/cs_content_seo][/cs_element_layout_column][/cs_element_layout_row][/cs_element_section][/cs_content]



















