# Consent banner

> Clerion needs no consent banner. If your policy wants one anyway, one script tag shows it, loads the tracker, and keeps a visitor id only for people who accept.

Clerion sets no cookies and stores no personal data, so it needs no consent banner and none is shown by default. Some teams want one anyway, for their own policy or because other scripts on the site need it. Clerion's banner is one script tag that shows the banner, loads the tracker itself, and remembers the visitor's choice.

## Add it

Replace the normal snippet with the banner's. Use the copy from your dashboard; it carries your key and site id.

```html
<script
  src="https://api.getclerion.com/sdk/clerion-consent-banner.js"
  data-api-key="YOUR_API_KEY"
  data-website-id="YOUR_WEBSITE_ID"
  data-theme="auto"
></script>
```

Do not keep the plain snippet as well: the banner starts the tracker, and two trackers count every visit twice.

## What each choice does

| The visitor | What Clerion does |
|---|---|
| Has not chosen yet | Tracks the visit without keeping anything between visits. Nothing is written to the browser. |
| Clicks Accept | Writes the `clerion_consent` cookie and keeps a visitor id for a year, so [Revenue by source](https://getclerion.com/docs/revenue-by-source) can follow them across visits. |
| Clicks Reject | Writes the cookie as a refusal. That browser is not tracked, now or on later visits, until the cookie expires. |

The choice lasts 365 days. Settings reopens the banner so a visitor can change it.

## Appearance

Optional attributes on the same tag:

| Attribute | Values | Default |
|---|---|---|
| `data-theme` | `light`, `dark`, `auto` (follows the visitor's system) | `light` |
| `data-position` | `bottom`, `top` | `bottom` |
| `data-accent-color` | Any CSS colour, for buttons and links | `#007acc` |
| `data-font-family` | A CSS font stack; `inherit` uses your site's font | System font |
| `data-border-radius` | Button corner radius in pixels | `4` |
| `data-title` | The banner's heading | We use cookies and analytics |
| `data-description` | The sentence under it | A short line about privacy-friendly analytics |
| `data-privacy-url` | A link to your privacy policy | None |

```html
<script src="https://api.getclerion.com/sdk/clerion-consent-banner.js"
  data-api-key="YOUR_API_KEY" data-website-id="YOUR_WEBSITE_ID"
  data-theme="dark" data-accent-color="#0066CC" data-font-family="inherit"
  data-title="One cookie, your call"
  data-description="We count visits without tracking you. Accept to help us tell returning readers from new ones."
  data-privacy-url="https://yoursite.com/privacy"></script>
```

## Your own banner

If you already have a consent tool, keep it and tell Clerion the result:

```js
window.clerion.setConsentStatus(true);  // accepted
window.clerion.setConsentStatus(false); // rejected
```

Call it when your banner records a choice. The tracker writes the same cookie and behaves exactly as above. Load the normal snippet in this case, not the banner's.

## Questions

### Does the banner make Clerion set cookies?

One: the visitor's choice, under the name `clerion_consent`. Acceptance also stores a visitor id in the browser. Neither exists unless the banner, or your own call to `setConsentStatus`, is in use.

### Does rejecting break anything on my site?

No. The tracker stops; the page is unaffected.

---

Source: https://getclerion.com/docs/consent-banner (Clerion docs, Reference). The whole manual as one file: https://getclerion.com/docs/everything.md
