> For the complete documentation index, see [llms.txt](https://docs.zigpoll.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zigpoll.com/tutorials/exit-intent-mobile.md).

# Exit Intent on Mobile

How Zigpoll detects exit intent on mobile devices

On desktop, exit intent is detected by tracking the user's cursor as it leaves the top of the browser window. On mobile devices, there is no cursor to track, so a different approach is needed.

#### How Mobile Exit Intent Works

On a phone or tablet, Zigpoll opens an exit intent survey on the first of these signals:

1. **A fast upward scroll.** Mobile browsers make people scroll up to reach the address bar, and they do it much faster than scrolling up to read. Very fast flings are ignored.
2. **Switching away.** The visitor switches to another tab or app.
3. **Going idle.** The visitor hasn't scrolled or touched the page for a while: 45 seconds by default.

Each of these only counts once the **Exit Intent Timer** has passed.

#### Sensitivity

**Sensitivity** on **Settings → Delivery → Trigger** changes how eagerly each signal fires:

| Sensitivity                    | Upward scroll needed | Idle time  |
| ------------------------------ | -------------------- | ---------- |
| Less sensitive                 | Fastest              | 60 seconds |
| Moderately sensitive (default) | Fast                 | 45 seconds |
| Very sensitive                 | Slower               | 30 seconds |
| Extremely sensitive            | Slowest              | 20 seconds |

Move the slider down if the survey opens while people are still browsing. Move it up if it rarely opens.

{% hint style="info" %}
To test on your phone, wait for the Exit Intent Timer to pass, then scroll up quickly toward the address bar. Use a private window, since a survey you've already completed or closed may not show again.
{% endhint %}

#### Desktop only or mobile only

To use exit intent on just one kind of device, set **Device** on **Settings → Delivery → Trigger** to **Desktop Only** or **Mobile Only**. For different questions on desktop and mobile, create two surveys and set one to each.

#### Custom Implementation

If you want to implement your own mobile exit intent logic, you can use the [Javascript API](/javascript-api.md) to trigger a survey programmatically. Here's an example of scroll speed detection:

```javascript
function myScrollSpeedFunction() {
  const delta = my_scroll();
  if (delta < -80) {
    // Trigger your Zigpoll survey here
    window.Zigpoll.open();
  }
}

var my_scroll = (() => {
  let last_position, new_position, timer, delta, delay = 50;

  function clear() {
    last_position = null;
    delta = 0;
  }

  clear();
  return () => {
    new_position = window.scrollY;
    if (last_position != null) {
      delta = new_position - last_position;
    }
    last_position = new_position;
    clearTimeout(timer);
    timer = setTimeout(clear, delay);
    return delta;
  };
})();

document.addEventListener('scroll', myScrollSpeedFunction);
```

You can adjust the threshold (default `-80`) to be more or less sensitive. You might also wait until the user has scrolled at least 50% down the page before initializing this script.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zigpoll.com/tutorials/exit-intent-mobile.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
