See what happens on your site once TermsFeed Free Cookie Consent runs
Cookie Consent is a free script that shows a cookie banner and, in its default express mode, holds each optional tagged script until the visitor accepts its category. You paste the generator code into your pages and set 2 attributes on each optional tracking script. The ePrivacy Directive in the European Union (EU) and the Privacy and Electronic Communications Regulations (PECR) in the UK require consent before most non-essential cookies load. The consent banner collects that consent. The General Data Protection Regulation (GDPR) defines what counts as valid consent.
Cookie Consent has no dashboard and no account. Every setting is an option in the JavaScript code you paste. From those options, the cookies in the browser, and, without a language option, the browser languages, Cookie Consent decides what to show and which scripts run.
What a visitor sees on the first page load
A visitor who has not answered sees the consent banner on every page until they answer. The consent banner has the title "We use cookies" and a sentence that lists the purposes of the categories you use. In express mode with the generator defaults, its 3 buttons read "I agree", "I decline", and "Change my preferences". The consent banner does not offer a close button and ignores the Escape key, so the visitor has to answer.
The "Change my preferences" button opens the Preferences Center, a dialog titled "Cookies Preferences Center". The Preferences Center has a "Your privacy" tab, one tab per category you use, and a "More information" tab, with a switch in each category tab, locked on for strictly-necessary. By default, the Preferences Center closes with its close button or the Escape key, which discards unsaved changes.
The "I agree" button accepts every category you use, and the "I decline" button rejects every category except strictly-necessary. The "Save my preferences" button saves the switches as the visitor left them, even untouched ones.
What Cookie Consent stores in the browser
Cookie Consent writes 3 first-party cookies and nothing else: no localStorage, no server record. The cookies are cookie_consent_level (the choice for each of the 4 categories), cookie_consent_user_accepted (set to true once the visitor answers), and cookie_consent_user_consent_token (a 12-character token). Consent lasts 365 days (12 months) by default, counted from the last write, and 7 days in Safari, which caps cookies written by JavaScript.
No change to an option other than demo, and no change to the texts of a self-hosted copy, shows the consent banner again to visitors who answered. Read the format of each cookie and how to change its lifetime in Consent Cookie Storage and Duration.
How Cookie Consent holds optional scripts by default until the visitor accepts
Cookie Consent controls only the scripts you tag, and by default holds each optional one until the visitor accepts its category. A tagged script is a <script> element with type="text/plain" and a data-cookie-consent attribute that names 1 of the 4 categories. The browser does not run a text/plain script, so the script waits. In express mode, only strictly-necessary tagged scripts run before the answer, unless the page_load_consent_levels option lists more categories.
The visitor clicks the "I agree" button, and Cookie Consent runs the waiting scripts at once, by default with no page reload. Scripts you leave untagged run as usual, whatever the visitor answers. Learn the tag and the order scripts run in with Block Scripts Until Consent.
Tagged scripts stop from the next page load after a visitor withdraws consent. Scripts that already ran keep running on the current page, unless the page_refresh_confirmation_buttons option reloads it. Cookie Consent does not delete cookies that other scripts already set.
What Cookie Consent does not do
Cookie Consent shows the same consent banner to every visitor, wherever the visitor is, and does not keep a record of consent on a server. It does not detect where the visitor is, scan your site for cookies, produce an IAB Transparency and Consent Framework (TCF) string, block iframes, or read Global Privacy Control. Check every limit, with a workaround or an alternative for each, in Limits of Free Cookie Consent: What It Does Not Do.
Where you create the Cookie Consent code and what it loads
You create the code in the TermsFeed generator at termsfeed.com/cookie-consent, and its script tag points to the loader at https://www.termsfeed.com/public/cookie-consent/4.2.0/cookie-consent.js. The generator writes 2 script tags, plus any script you add in its optional step. The 2 tags are the loader and an inline script after it that calls cookieconsent.run() with your options. Below them sit a <noscript> element and a link that reopens the Preferences Center.
The 4.2.0 in the address is the version your site runs. Paste the code on your site with Install a Cookie Banner on Any Website.