Add a free cookie banner that, by default, holds the optional scripts you tag until visitors accept
TermsFeed Free Cookie Consent is a free cookie banner script that, by default, holds each optional script you tag until the visitor accepts its category. The TermsFeed generator writes the code, 2 script tags, plus any script you add in its optional step, and you paste it before the closing </body> tag. The visitor answers in the consent banner or in the Preferences Center, and Cookie Consent stores the answer in 3 first-party cookies.
Every setting is an option of one JavaScript object in your page, with no dashboard and no account. This manual describes version 4.2.0, which https://www.termsfeed.com/public/cookie-consent/4.2.0/cookie-consent.js serves. Cookie Consent shows the same consent banner to visitors in every country and does not keep a consent log. Check every limit before you start with Limits of Free Cookie Consent: What It Does Not Do.
Set up your first consent banner with Cookie Consent
Tag every optional script that sets a cookie, stores data in the browser, or sends data to another company. Scripts you leave untagged run before consent.
| Page |
What you get there |
| Compliance |
Which laws ask for a consent banner, the reject button, and proof of consent |
| Get Started |
The setup stages and the time each takes |
| Install the Code |
The 4 install steps, and where the code goes on Shopify, WordPress, Wix, Squarespace, Webflow, static sites, and other platforms |
| Tag Your Scripts |
The tag for inline and external scripts, and the category each script takes |
| Verify Your Installation |
The checks in a private window, and the options, scripts, and page elements to confirm before launch |
Site builders add analytics and pixels from their own settings screens, outside the code you tag. Cookie Consent does not send consent signals of its own, so your callback code passes the choice to each vendor.
| Page |
What you get there |
| 2 Consent Banners |
How to turn off the consent banner your platform shows |
| Category Mapping |
The Google, Microsoft, Meta, TikTok, and HubSpot signals each category grants |
| Google Consent Mode v2 |
The denied defaults and the update from the callback |
| Integrations |
Consent signals, embeds, and the recipes for analytics and advertising tools, YouTube, and Calendly |
| Embeds and Iframes |
A placeholder that a tagged script replaces with the embed |
Change how the consent banner looks and where it runs
| Page |
What you get there |
| Configuration |
Layouts, colors, languages, the preferences link, storage, subdomains, and reloads |
| Single-Page Apps |
One run() per page load, page views on route changes, and the setup for React, Next.js, Vue, Nuxt, Angular, SvelteKit, Astro, and Turbo |
| Proof of Consent |
A record of each answer from your own callback code |
Build on Cookie Consent as a developer
| Page |
What you get there |
| Developers |
Every reference page and developer guide |
| API Reference |
The global object, all 24 options, the tagged script attributes, and the cookies |
| Callbacks and DOM Events |
The 7 callbacks and 12 DOM events, and the order they run in |
| Versions and Upgrades |
How to tell which version a site runs and how to move to 4.2.0 |
Fix a Cookie Consent problem
| Page |
What you get there |
| Troubleshooting |
The browser checks to run first, then each problem listed by symptom |
| Questions and Support |
Short answers on compliance, platforms, storage, and wording, video tutorials, and where to get help |