# Optional website consent bar — controlled preview

Use only when your business has enabled Tier B in Kyloth, has no existing consent tool,
and uses direct counting. This is one analytics purpose, not a general legal compliance tool.
Do not add it to Clinic or Class websites. Obtain the required privacy review and keep
collection behind its existing preview gate. Your privacy notice must accurately describe
purpose, Kyloth processing, retention and erasure; draft notice generation is still pending.

Place a visible empty mount near your site footer. Load configuration, bar, adapter, then
counting in that order, after the mount exists. Keep the change-choice control reachable
on every page. Example (replace the synthetic key and your real notice URL):

```html
<div id="kyloth-visit-choice"></div>
<script>
window.kylothConsentBarConfig = {
  enabled: true,
  tierB: true,
  hasConsentTool: false,
  mode: 'direct',
  siteKey: 'ksite_AbCdEfGhIjKlMnOpQrStUv',
  privacyUrl: '/privacy',
  mountId: 'kyloth-visit-choice'
};
</script>
<script src="https://kyloth.com/integrations/kyloth-consent-bar-1.js"></script>
<script src="https://kyloth.com/integrations/kyloth-consent-1.js"></script>
<!-- Existing Kyloth counting script follows; use the same site key. -->
```

The bar queues the current explicit choice before the adapter starts. Loading the adapter first
queues an initial refusal and can unnecessarily replace an already permitted visitor identifier.
Do not load these files with async or start counting before both are ready.

Use your approved application host or self-host the reviewed files. CSP must allow these
scripts; move configuration into an allowed file or apply your reviewed nonce policy.
The bar uses an isolated Shadow DOM style; provide `styleNonce` when your style-src policy
requires a nonce. If configuration, adapter, bar, mount or styling is unavailable, keep the
counting tag blocked and fix installation first. These scripts do not automatically insert
or activate the counting tag. A missing bar cannot be treated as permission.

Accept and Reject have identical styling. Reject and withdrawal remove visitor memory;
source-only counting can continue. Click Change visit choice, then Reject to withdraw.
Previously linked enquiry trails need the business's separate erasure process.

The bar stores only an explicit choice (granted or denied, version and expiry) in
`kyl-choice:<public-site-key>` after a click, for up to180 days. It does not read a visitor
identifier as evidence of choice. Expired or malformed choices are refused. Cross-tab
changes and returning focus recheck the choice. If browser storage is unavailable, the
choice applies to this page and the bar explains that it may ask again on the next page.
Do not manually manufacture a granted record. Kyloth's own website consent is unrelated.

Global Privacy Control and Do Not Track suppress this bar and deny visitor memory. Counts-only
WordPress relay also suppresses it; configure mode 'counts' and do not install a second
counting script. The bar checks matching installed snippet endpoint URLs as an additional
safeguard. Server Tier B remains authoritative; this configuration does not enable it.

Verify keyboard access, equal choices, notice link, narrow/mobile layout, reload, withdrawal,
CSP and cross-tab refusal on your actual website before publication. Component tests are not
browser, real CMP or legal acceptance. Use a complete CMP when multiple purposes or policies
require one. To uninstall, withdraw first, remove this bar and its configuration, remove
counting or ensure your replacement CMP denies by default, and clear cached pages.
