Change how your cookie banner looks and behaves with one configuration object
Every setting of TermsFeed Free Cookie Consent is a key in one JavaScript object, the argument you pass to cookieconsent.run(). Cookie Consent has no dashboard, so each change is an edit to the snippet in your page, followed by a deploy and a reload.
The configuration object sits in the second script tag of the snippet the TermsFeed generator writes. A typical object holds the generator options plus the address of your Privacy Policy.
<script type="text/javascript" charset="UTF-8">
document.addEventListener('DOMContentLoaded', function () {
cookieconsent.run({
"notice_banner_type": "headline",
"consent_type": "express",
"palette": "dark",
"language": "en",
"page_load_consent_levels": ["strictly-necessary"],
"notice_banner_reject_button_hide": false,
"preferences_center_close_button_hide": false,
"page_refresh_confirmation_buttons": false,
"website_privacy_policy_url": "https://www.example.com/privacy-policy"
});
});
</script>
Every on/off option turns on with true or "true" in any letter case, and any other value, including "false", 1, and "yes", leaves it off. An option with a fixed list of values, such as palette or notice_banner_type, ignores case and falls back to its default for an unknown value. With debug on, the console warns about the unknown value. Look up the type, the allowed values, and the default of all 24 options in the API reference.
Choose when tagged scripts run
Choose whether scripts wait by default until the visitor answers or run at once, and what runs before the answer.
| Page | What it covers |
|---|---|
| Express and Implied Consent | The 2 consent types, what page_load_consent_levels runs before the answer, and why express consent suits EU, UK, and Swiss visitors. |
Change how the consent banner looks
Set the layout, the colors, and the language of the consent banner and the Preferences Center, and replace the texts of the consent banner.
| Page | What it covers |
|---|---|
| Cookie Banner Layouts | The 4 layouts of notice_banner_type, how each one sits on the page and on small screens, and the legal links on the consent banner. |
| Cookie Banner Colors and Custom CSS | The light and dark palettes, the CSS selectors that override the built-in styles, and the elements most sites restyle. |
| Change the Cookie Banner Text | A short script that replaces the title and the button labels of the consent banner and keeps the hosted script. |
| Cookie Banner Languages | The 36 language codes, how the language is chosen, the language menu in the Preferences Center, and right-to-left languages. |
Reopen the choices and decide where the answer is stored
Give visitors a cookie settings link, decide how long the cookies keep their answer, and share one answer across your subdomains.
| Page | What it covers |
|---|---|
| Add a Cookie Settings Link | A link, a menu item, or your own code that opens the Preferences Center again after the visitor answered. |
| Consent Cookie Storage and Duration | The 3 cookies, the 365-day default, what rejecting leaves behind, and how to ask every visitor again. |
| Share Consent Across Subdomains | One cookie_domain on every subdomain, so visitors answer once for the whole site. |
Reload after an answer, trim categories, and place the consent banner
Reload the page after an answer, hide the categories your site does not use and the close button of the Preferences Center, or choose where in <body> the consent banner sits.
| Page | What it covers |
|---|---|
| Reload the Page After Consent | When a reload after a click on the "I agree", "I decline", or "Save my preferences" button helps, and the form input, scroll position, and referrer it clears. |
| Hide Cookie Categories and Buttons | Only the categories you use, the close button of the Preferences Center, why the "I decline" button stays, and where the consent banner sits in <body>. |