Cookie declaration
The cookie declaration is the public list of cookies your site sets. It is generated from your scan results and the OptSens categorized library, then embedded on your site, where visitors see exactly what is stored and why.
What it contains
Cookies are grouped by their consent category. For each cookie the table shows:
- The cookie name
- The provider or domain that sets it
- A description of what the cookie is used for
- The expiry, or Session for cookies that clear when the browser closes
The Necessary group is labeled Always active, because those cookies are never blocked. The other groups follow the visitor's consent choices.
How it is generated
- The scanner records the cookies set while loading your pages.
- Each cookie is matched against the OptSens library and placed in a category. Cookies you recategorized on the Scripts and cookies page use your category instead.
- The grouped result becomes the declaration. The dashboard preview shows the same data, with a count of cookies and categories and the date of the last scan.
The declaration refreshes when a new scan completes. Your category overrides survive each rescan.
Cookie names with wildcards
Some providers create cookies with a changing suffix. Google Analytics, for
example, sets _ga_XXXXXXX where the suffix differs per property. OptSens
collapses these into a single wildcard entry to keep the declaration readable:
_ga_*
One row covers every cookie that matches the pattern, rather than listing each variant.
If a cookie is missing or wrong
- A cookie is missing from the declaration: it was probably set on a page the scan did not reach, or only after an action the scanner does not perform. Run a new scan, or add the cookie from the scanner page.
- A cookie is in the wrong category: change it on the Scripts and cookies page. The declaration updates to match.
- The declaration is empty: the scan likely returned nothing. See OptSensBot for blocked-scan causes.
Showing it to visitors
The declaration is part of your banner. Visitors reach it from the preference center, where each category can be expanded to see the cookies inside it.
Put it on your privacy policy page
The declaration also embeds as a standalone table on any page, typically your privacy or cookie policy page. The Integration page in the dashboard and the integration step of onboarding both carry the copy-ready snippet, pre-filled with your Domain ID:
<script src="https://cdn.optsens.com/api/public/declaration-script/YOUR_DOMAIN_ID" defer></script>
Paste it where the table should appear. It renders in place, grouped by category, and inherits your page's font and text colors, which makes it read as part of your design.
Declaration language
To render the embedded declaration in a specific language, add ?lang=
with a language code to the script URL:
<script src="https://cdn.optsens.com/api/public/declaration-script/YOUR_DOMAIN_ID?lang=sr" defer></script>
Over 50 languages are supported. Without the parameter, the banner's default language is used.