# Script tag

> Every attribute the Clerion snippet reads: the key and site id, the API address, auto-tracking, debug mode, turning tracking off, and the exit question.

The snippet configures itself from attributes on its own `<script>` tag. Only the key is required; the copy in your dashboard already carries the key and the site id.

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

## Attributes

| Attribute | Value | What it does |
|---|---|---|
| `data-api-key` | Your tracking key, starting `cle_` | Required. Without it the snippet does nothing. |
| `data-website-id` | Your site id, starting `site_` | The site the visits belong to. |
| `data-api-url` | A URL | Where events are sent. Defaults to the API on the host the script was loaded from; leave it unset. |
| `data-auto-track` | `false` | Turns off automatic tracking: no pageviews, clicks, scroll, forms, speed, errors, rage clicks or exit question. Session starts and what you send with the [JavaScript API](https://getclerion.com/docs/javascript-api) are still recorded. |
| `data-debug` | `true` | Logs each batch of events to the browser console as it is sent, and any tracker error. See [Check your installation](https://getclerion.com/docs/check-installation). |
| `data-disabled` | `true` | Turns tracking off entirely, for a staging site that shares the template. |
| `data-exit-question` | Paths, comma-separated | Asks visitors leaving those pages why. `/pricing` matches one page, `/docs/*` every page under it, `*` every page. See [Exit question](https://getclerion.com/docs/exit-question). |

## In Next.js

```tsx
import Script from "next/script";

export default function RootLayout({ children }) {
  return (
    <html><body>{children}
      <Script src="https://api.getclerion.com/sdk/clerion-analytics.js" data-api-key="YOUR_API_KEY" data-website-id="YOUR_WEBSITE_ID" strategy="afterInteractive" />
    </body></html>
  );
}
```

## Every other option

Sampling, batching, the session timeout, which automatic events to record and the consent settings are not attributes. Start the tracker yourself to set them: see [Configuration options](https://getclerion.com/docs/configuration).

## What the snippet does not need

No cookie and no consent banner: Clerion counts visits without setting cookies. The one cookie it knows is the visitor's choice, and only if you turn on the optional consent banner. No event plan: everything in [What is tracked automatically](https://getclerion.com/docs/quickstart#what-is-tracked-automatically) is on by default.

## Privacy signals

The snippet honours Global Privacy Control and Do Not Track. A visitor with either turned on is not tracked, and the exit question is never shown to them.

---

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