Docs Reference
View as MarkdownConsent banner
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.
<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 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 |
<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:
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.