> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abtestly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Visitor opt-out

> A single URL parameter that removes a visitor from every test on your site, including future tests, for two years.

Some visitors need to be out of every experiment. A member of your QA team,
a support agent looking at a customer's cart, a lawyer testing a checkout
flow, or anybody who explicitly asks not to participate. ABTestly ships an
opt-out URL that handles all of those.

## The URLs to share

Both of these URLs live in your **Settings → Opt-out** panel with a copy
button next to each:

* `https://YOURSITE.com/?abtestly_optout=1`, opt this browser out.
* `https://YOURSITE.com/?abtestly_optout=0`, opt this browser back in.

<Frame caption="Settings → Opt-out. Copy either URL and share it with the visitor.">
  <img src="https://mintcdn.com/abtestly/pnpJFDTFa50Ks6SL/images/settings-optout.png?fit=max&auto=format&n=pnpJFDTFa50Ks6SL&q=85&s=f2b3225d99f7623ffcbee84d21d70e9d" alt="Opt-out settings" width="2400" height="1141" data-path="images/settings-optout.png" />
</Frame>

The visitor loads either URL once. The snippet reads the query parameter,
writes a cookie, and that decision sticks for two years or until the
visitor clears their browser data.

## What "opt out" actually does

An opted-out visitor:

* Never gets bucketed into any experiment. Existing bucket cache is
  cleared.
* Never has variant CSS or JavaScript applied.
* Never sends an exposure or a goal beacon to ABTestly.

The visitor still browses your site normally. Only the ABTestly runtime
stops firing.

## Cookie details

* Cookie name: `__abtestly_optout`
* Value: `1`
* Domain: your effective top-level plus one (eTLD+1), so it covers
  `www.acme.com`, `app.acme.com`, and any other subdomain of your site.
* Max age: two years.

## What if the cookie cannot be written

The snippet fails **closed**. If it cannot verify that the cookie was
written, the browser rejected it, the domain is a raw IP, whatever the
reason, the current pageview is still suppressed. It errs on the side of
respecting the opt-out even when it cannot remember it for next time.

The same applies in reverse. An opt-back-in request that could not clear
the cookie leaves the visitor opted out.

## Preview vs opt-out

The [preview modal](/preview/preview-modal) can override the runtime for
QA purposes, but a preview link cannot swallow the opt-out URL. If a
visitor clicks the opt-out URL you gave them, they are opted out even if
they later use a preview link, as they should be.

## Why not the browser's Do Not Track header

Do Not Track is not enforced anywhere and most browsers no longer send it.
A URL your visitor can click is something you can point them to, share in
an email, or put in a support macro.

## How this composes with consent

If you also use [consent gating](/install/consent), for example, deferred
mode with a `consentKey`, the two mechanisms compose. The snippet does not
fire until *both* apply: consent is granted **and** the visitor is not
opted out.
