Docs Visitor insight
View as MarkdownExit question
To ask visitors why they leave, add data-exit-question to your Clerion snippet with the pages you care about, for example data-exit-question="/pricing,/signup". When a visitor on one of those pages moves to leave, after at least five seconds there, a small card asks "Before you go, what stopped you?" with five answers. Each visitor is asked once per page, and the answers appear on the Custom events page and in your briefing.
Before you start
The Clerion snippet must already be on the pages you want to ask on. If it is not, set up Clerion first. The question uses the snippet that is already there; there is no second script.
Pick the pages where leaving costs you something: pricing, signup, checkout, a product page that gets traffic and few sales. Asking on every page tells you less, because a visitor reading your blog and leaving is usually done, not stuck.
Add the attribute
Add data-exit-question to the script tag you pasted, with the paths separated by commas:
<script src="https://api.getclerion.com/sdk/clerion-analytics.js"
data-api-key="cle_..." data-website-id="site_..."
data-exit-question="/pricing,/signup"></script>
Keep your own data-api-key and data-website-id; only the last attribute is new. Paths match like this:
| You write | It asks on |
|---|---|
/pricing | Exactly /pricing |
/docs/* | Every page whose path starts with /docs/ |
* | Every page |
In Next.js, the same attribute goes on the Script:
<Script
src="https://api.getclerion.com/sdk/clerion-analytics.js"
data-api-key="YOUR_API_KEY"
data-website-id="YOUR_WEBSITE_ID"
data-exit-question="/pricing,/signup"
strategy="afterInteractive"
/>
Publish the change. There is nothing to turn on in the dashboard.
What the visitor sees
A small white card in the bottom right corner with the question and five answers:
- Too expensive
- Not sure what it does
- Missing a feature
- Something broke
- Just looking
One click sends the answer and the card thanks them and closes. The close button or the Escape key dismisses it without an answer.
It appears when the pointer leaves the window through the top, which is what people do on the way to the tab bar or the back button, and only after five seconds on the page, so nobody is asked on arrival.
Read the answers
Open your site, go to Behavior, then Custom events. The card Why visitors left lists each page that has answers, with how many people answered and the share of each answer, most common first.
When one answer dominates a page, it usually explains the drop-off there better than any metric. Too expensive on pricing is a pricing conversation; Not sure what it does on pricing is a copy problem on the pages before it.
The answers also reach your briefing and Ask Clerion, so "why do people leave the pricing page?" is answered with what visitors said.
Limits
| Limit | What it means for you |
|---|---|
| Desktop only | Phones have no leaving gesture to read, so phone visitors are never asked. |
| Once per visitor per page | Remembered in the visitor's browser. A dismissed card counts as asked. If the browser blocks storage, the visitor is not asked at all. |
| Five fixed answers | There is no free text, which keeps it to one click and keeps the answers comparable. |
| Only when tracking runs | Visitors with Global Privacy Control or Do Not Track on, or who declined the consent banner, are not asked. |
| Not a goal | Answers are recorded as exit_answer, which never shows up as a custom event or a conversion. |
If nobody is being asked
- Check the attribute is on the script tag the page really loads, and the path matches the page exactly, including any trailing part such as
/pricing/annual. - Test on a desktop browser: stay on the page for five seconds, then move the pointer up past the top of the window.
- If you were asked once already in that browser, you will not be asked again. Try a private window.
Questions
Does the exit question need a cookie banner?
No. It stores one small marker in the visitor's browser so they are not asked twice, and records the answer as an anonymous event, like the rest of Clerion.
Can I change the question or the answers?
Not yet. The wording is fixed so answers mean the same thing across pages and sites.
Does it slow the page down?
No. The card is built only when it is shown, from the snippet already on the page.
Can I ask on a single-page app?
Yes. The path is read when the pointer leaves, so client-side navigation is followed, and the five-second wait starts again after each page change.