Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungFliproom: a room changeover is a content problem(21.09.2026 um 04:10 Uhr)
Sichere ProgrammierungNova Adiutrix: My Second Agent Built My First Project's To-Do List(21.09.2026 um 04:11 Uhr)
Sichere ProgrammierungFliproom: a room changeover is a content problem(21.09.2026 um 04:10 Uhr)
Sichere ProgrammierungNova Adiutrix: My Second Agent Built My First Project's To-Do List(21.09.2026 um 04:11 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Exit intent that works on mobile, not just desktop

Reagiere als Erste:r — dein Feedback zählt!

Originally published on my site, arafatcro.dev/guides.

You copy the exit-intent snippet, it fires nicely when the cursor heads for the close button, and you ship. Then you check the data and half your traffic never triggered it, because they were on phones and a phone has no cursor to chase. Exit intent is not one trick. It is a different signal on each device, fired once, and built so it does not become the thing people leave over.

The trick everyone copies

The standard snippet listens for the mouse leaving the top of the page. When the cursor crosses the top edge, heading for the tab bar or the close control, you call it intent to leave and show your overlay. On desktop it works.

The problem is that this signal only exists on a device with a pointer. On a phone or tablet there is no cursor, nothing ever leaves the top of the viewport, and that listener never fires. So the most common exit-intent implementation does nothing for anyone on a phone, which on a lot of sites is more than half the traffic. Nobody notices, because it looks like it is working on the desktop where you tested it.

Detect the device, use the signal that exists on it

On desktop it is the cursor arcing toward the browser chrome. On touch you read it from behaviour instead: a fast flick upward toward the address bar, or a stretch of inactivity. None is as crisp as the desktop signal, so you tune the thresholds rather than firing on the first twitch. Put both behind one helper so your variation code does not care which fired.

function exitIntent(callback, {
  sensitivity = 20,        // px from the top edge that counts as "leaving"
  mobileScrollDelta = 60,  // px of fast upward scroll that counts as a flick
  idle = 0,                // ms of inactivity before firing (0 = off)
  once = true,
} = {}) {
  let fired = false;
  let lastY = window.scrollY;
  let idleTimer;

  function teardown() {
    document.removeEventListener("mouseout", onMouseOut);
    window.removeEventListener("scroll", onScroll);
    clearTimeout(idleTimer);
  }

  const trigger = () => {
    if (fired) return;
    if (once) fired = true;
    teardown();
    callback();
  };

  const onMouseOut = (e) => {
    if (!e.relatedTarget && e.clientY <= sensitivity) trigger();
  };

  const resetIdle = () => {
    clearTimeout(idleTimer);
    idleTimer = setTimeout(trigger, idle);
  };

  const onScroll = () => {
    const y = window.scrollY;
    if (lastY - y > mobileScrollDelta) trigger(); // fast flick upward
    lastY = y;
    if (idle) resetIdle();
  };

  document.addEventListener("mouseout", onMouseOut);
  window.addEventListener("scroll", onScroll, { passive: true });
  if (idle) resetIdle();

  return teardown;
}

This helper lives in ab-test-helpers, a small set of dependency-free helpers for client side tests.

Fire once, and do not nag

An overlay that reappears on every page stops being a save and becomes the reason someone leaves. Fire the detector once per session, and remember a dismissal so a visitor who said no is not asked again.

function allowOncePerDays(key, days = 7) {
  const name = `fc_${key}`;
  try {
    const until = Number(localStorage.getItem(name) || 0);
    if (Date.now() < until) return false;
    localStorage.setItem(name, String(Date.now() + days * 864e5));
    return true;
  } catch (e) {
    return true; // storage blocked: do not suppress
  }
}

exitIntent(() => {
  if (sessionStorage.getItem("exit_dismissed") === "1") return;
  if (!allowOncePerDays("exit_offer", 14)) return;
  showOverlay();
}, { idle: 20000 });

It is a modal, so make it accessible

The overlay is a dialog. Trap focus inside it, return focus on close, let Escape dismiss it, and give it the ARIA roles a screen reader needs. Skip these and a keyboard user is trapped behind it or lost on the page underneath.

Measure the intent, not just the impression

Fire an analytics event when leave intent is detected, separate from whether the overlay rendered. Then the control group logs exit intent too, and you can measure how often it happens and how the variation changed behaviour, not just count the people who saw the modal.

The short version

Exit intent is a desktop signal plus a couple of touch signals, behind one detector that fires once. Cap it so it does not nag, build it as a real dialog with a focus trap, and log the detection separately from the popup. Do that and it works for everyone, not just the half on a laptop.

I write up the hard parts of client side A/B testing at arafatcro.dev/guides. The full version of this post, with a comparison table of every signal, is here.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Exit intent that works on mobile, not just desktop

Thematisch verwandte Begriffe: Exit, intent, that, works · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93977 | A vulnerability was determined in code-projects Assessment Management 1.…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick