Cookie banner generator

Pick the categories.
Paste the banner.

A cookie banner generator writes the code for a consent banner from a few choices: which categories you ask about, what the banner says, and how visitors can refuse and change their mind. Choose a starting point, edit the words, try it in the frame and copy one block of CSS and JavaScript for the head of your site.

It runs in your browser and nothing you type is sent to us. Reject all sits beside Accept all, nothing optional starts switched on, and a Cookie settings button brings the choices back. It holds back only the scripts you mark, and it keeps no record of who agreed: both limits are spelled out below. Want blocking by tag, proof of consent and a cookie scanner? That is Builderify Cookie Consent.

CSS · JavaScript 3 starting points · 13 checks Checked 19 Nov 2026

By the Builderify team

Cookie banner generator Runs in your browser
Starting point
What do you ask about? Strictly necessary is always on and is not asked.

The words in each starting point are examples: replace them with what is true for your site. The policy link starts empty because only you know it.

Preview of the generated code

The frame runs the code below on a page with one demo script per category, which says “ran” once its category is allowed. Press Reject all, Replay, then Accept all to see the difference. The preview cannot store a cookie, so it asks again each time; on your site the answer is remembered.

First screen
Accept + Reject
Asks about
2 categories
Remembered
180 days
To look at
3 flags
  • Shows a card in the bottom corner with Accept all, Reject all and Settings on the first screen. It does not dim or block the page.
  • Asks about Statistics and Marketing. Strictly necessary is always on, and every toggle behind Settings starts off.
  • Remembers the answer in a first-party cookie, bfc_consent, for 180 days. It holds the category names and nothing else.
  • After a choice, a “Cookie settings” button stays on every page and reopens the choices. So does any element with data-bfc-open.
  • Sets Google’s four consent signals to denied first, and updates them when the visitor chooses.
First screen
Asks about
Remembered
To look at
The code · 10584 bytes, 273 lines
  • Look at A link to the cookie list

    The banner has no usable link to a page that lists your cookies, so the banner and its category lines are all the information a visitor gets. The ICO asks for clear and comprehensive information that is easily available.

    Try: Link your cookie policy. The cookie policy generator builds one from a list. Use a full address starting with https://, or a path starting with a single /.

    Source: ICO

  • Look at Your scripts are held back

    The banner cannot see which scripts your site loads. It releases only the ones you mark with type="text/plain" and data-bfc, and every other analytics or ad tag keeps running before anyone has answered. The ICO says you cannot set non-essential cookies on your homepage before the user has consented.

    Try: Mark each tag with the category it belongs to, then test in a private window: press Reject all and look at the cookies the site has set.

    Source: ICO

  • Look at Google signals run first

    The code sets Google’s four consent signals to denied as its first step, then updates them when the visitor chooses. Google says the default has to come before any command that sends measurement data, so this block has to sit above your Google tag. It also says you are responsible for making the defaults match your own policy.

    Try: Put the banner code above the Google tag in the head, and check in a private window that the tag only gets “granted” after you press Accept.

    Source: Google

  • Fine Title and text filled in

    The banner has a title and text.

  • Fine Reject all on the first screen

    Reject all sits on the first screen, next to Accept all.

  • Fine Refusing looks like accepting

    Reject all and Accept all share one style.

  • Fine Accept says what it does

    The accept button says what the visitor agrees to.

  • Fine Each category says why

    Every category has a line saying what it is for.

  • Fine A way to change the choice

    A Cookie settings button stays on every page after a choice.

  • Fine Choice not kept too long

    The choice is remembered for a year or less.

Each check names its source; the ones without one are ours. A banner that passes them is not a compliant site. Where the checks come from.

01 / What the code does

What is in the banner
you just copied?

One style block and one script. No library, no account, nothing loaded from another site, and one cookie of its own that stores only the visitor’s answer.

Releases the scripts you mark

A script you mark with type="text/plain" and data-bfc="statistics" does nothing until the visitor allows that category. Then the banner copies it into a live script tag, in page order. A script you do not mark runs as it always did, so every analytics and ad tag has to be marked. The ICO says you cannot set non-essential cookies on your website’s homepage before the user has consented. ICO, read 19 Nov 2026.

<script type="text/plain" data-bfc="statistics"
        src="https://example.com/analytics.js"></script>

Refusing is as easy as accepting

Reject all and Accept all are side by side on the first screen, with the same size and colour, and the toggles behind Settings start off. In the EDPB taskforce’s report a vast majority of authorities considered a banner with no refuse option on any layer with a consent button not in line with valid consent, and the taskforce confirmed that pre-ticked boxes do not lead to valid consent, quoting recital 32 of the GDPR: “Silence, pre-ticked boxes or inactivity should not therefore constitute consent.” EDPB, read 19 Nov 2026.

Remembers the answer, and nothing else

One first-party cookie, bfc_consent, holds the names of the categories allowed (or none) for the days you set, with SameSite=Lax and Secure on https. No visitor ID, no IP address and nothing sent to a server. List this cookie where you list the others: the cookie policy generator takes any entry you type.

Lets visitors change their mind

After a choice, a small Cookie settings button stays on every page, and any link or button of yours with data-bfc-open reopens the choices as the visitor left them. The taskforce report says withdrawal has to be possible at any time and as easy as giving consent, points to an icon or a link in a visible and standardised place, and says no one solution can be imposed. Withdrawing a category whose scripts have already run reloads the page once so they stop. Cookies those scripts already set stay in the browser until they expire, because the banner does not know their names.

Passes the answer to Google, if you ask

With the option on, the code sets Google’s four consent signals (ad_storage, ad_user_data, ad_personalization, analytics_storage) to denied as its first step, with wait_for_update of 500 ms as in Google’s own example, and sends an update when the visitor chooses: Statistics moves analytics_storage, Marketing moves the other three, Preferences moves none. Google says the default has to run before any command that sends measurement data, so the banner has to sit above your Google tag. Google, page last updated 13 Oct 2026, read 19 Nov 2026. The Consent Mode v2 guide covers the rest.

Stays out of the way

The banner is non-modal: it does not dim the page, trap focus or stop the visitor reading on. It is the first thing in the page for a keyboard or screen reader, Escape closes it once a choice exists, and the buttons are 44 pixels tall. On a phone the corner card spans the bottom edge, and a long list of categories scrolls inside the banner. The slide-in is switched off for visitors who ask for reduced motion.

We tested the generated banners in Chrome at desktop and phone widths. We have not tested them with a screen reader, on a physical phone or in older browsers, so try yours on the devices your visitors use before you publish.

02 / The rules behind the checks

Where do the checks
come from?

Most of them come from two regulators’ pages: a report by the European data protection authorities on cookie banner complaints, and the UK’s ICO guidance. Where a check is our own rule of thumb, it says so.

The cookie banner checks, what each looks for and the page it rests on
Check What it looks for What the source says
Reject on the first screen A Reject button next to Accept, not only behind Settings. EDPB taskforce, paragraph 8: a vast majority of authorities considered the absence of a refuse option on any layer with a consent button not in line with valid consent. A few said they could not find an infringement, as Article 5(3) of the ePrivacy Directive does not name a reject option.
Same weight A refusal that is not a faint link beside a bold button. Paragraphs 13 and 14: a banner must not push the user to consent, and a refusal that is only a link, without enough visual support, does not lead to valid consent. Paragraph 17: no general colour or contrast standard can be imposed, so each banner is judged case by case.
A way back A button or link that reopens the choices. Paragraphs 32 to 35: websites should offer easily accessible ways to withdraw consent at any time, such as a small permanently visible icon or a link in a visible and standardised place, and withdrawing must be as easy as giving consent. No specific solution can be imposed.
Clear wording An accept button that says what it does, and a line for each category. ICO: consent must be freely given, specific and informed, and given by a clear positive action; people must fully understand they are giving it. You must explain what the cookies are doing and why.
Scripts held back A reminder that the banner only releases what you mark. ICO: you cannot set non-essential cookies on your website’s homepage before the user has consented.
Preferences only A site that asks about nothing but preferences. EDPB taskforce, paragraph 30, recalling the Article 29 Working Party’s opinion: cookies that retain the preferences a user expressed about a service should be deemed essential. The ICO names language-preference cookies as likely to be exempt.
Google signals The order of the code, and whether Google tags hear the choice. Google: set a default consent state before any command that sends measurement data, and update it when the visitor chooses. You are responsible for making the defaults match your organisation’s policy.
How long to remember A choice kept for more than a year. ICO: devices may be used by different people, so consider repeating the process at suitable intervals, and you may need fresh consent if your use of cookies changes. The one-year line is ours.

Sources: the EDPB Cookie Banner Taskforce report, the ICO’s cookies guidance and Google’s consent mode page, all opened on 19 November 2026.

What these pages are not

The taskforce report says its own positions are “a minimum threshold” that do “not constitute stand-alone recommendations or findings to obtain a greenlight from a competent authority”, and that national laws and each authority’s own guidance still apply. The ICO page says it is based on the previous version of its detailed cookies guidance, which it is consulting on revising. Neither covers the United States, where state laws mostly ask for an opt-out rather than a yes. A banner that passes every check here is a banner that avoids the mistakes those pages name, not a compliant website.

Whether you need a banner at all depends on what your site sets and who visits it: see do I need a cookie banner, which covers the EU, the UK and the US. This is general information, not legal advice.

03 / What it cannot do

Where a pasted banner
runs out.

For a small site whose tags you can mark by hand, the code you copied is a start. It stops short when you need to hold back tags you cannot edit, keep proof of each answer, or find out what your site sets.

What the pasted banner does and what Builderify Cookie Consent does, for seven jobs
The job This pasted banner Builderify Cookie Consent
Holding tags back Only the scripts you mark by hand, one by one. Tags you connect by ID load only after the visitor allows their category (thirteen can be connected, including Meta, TikTok, Google Ads, GA4, LinkedIn and Microsoft Clarity), or you mark your own the same way.
Cookies of a refused category Cookies a script already set stay in the browser until they expire. The declared cookies of a refused category are deleted.
Proof of each answer None. The cookie holds the answer; nothing records it. Every decision is logged for 24 months, with the IP address truncated.
Finding what the site sets You list the cookies yourself, from your browser’s developer tools. A cookie scanner, which uses no credits.
Global Privacy Control Not read. A Global Privacy Control signal is honoured.
Google signals Four, as set out above. All seven Consent Mode signals, set before your Google tags run.
Changing it later Edit the code and paste it again. Design the banner in the dashboard and switch it on; the consent tag on your site stays the same.

The right-hand column is from our Cookie Consent page and the guide to whether you need a cookie banner. Neither a banner like this one nor Cookie Consent makes a site compliant by itself: what your site sets, and what your policies say, are still your decisions.

If you want the other column

Builderify Cookie Consent is free to start: every account gets 250 credits a month, and page loads with the widget on them cost 10 credits per 1,000. Consent decisions, the consent log, the cookie scanner and the consent tag use no credits of their own. If you need more, one-time packs start at $9, purchased credits never expire and there is no monthly fee. See pricing, or start free.

04 / Put it on your site

How do I add the code
to my website?

Paste it into the head of your site, above every analytics and ad script, then mark those scripts so the banner can hold them back. Where the head code box is depends on your platform and plan: the menu path for each is in our guide to adding custom code to your website header and footer.

1. Copy the code

Press Copy code above. It is one block: four comment lines, a style tag and a script. Edit the words in the C block at the top of the script if you want to change them later.

2. Paste it high in the head

It has to run before your tags do. If you use Google tags and left the Google signals on, the banner must sit above the Google tag, because Google’s default has to come first. The banner itself waits for the page to load before it appears.

3. Mark your scripts

Change each analytics, advert or pixel tag to type="text/plain" with data-bfc="statistics" or data-bfc="marketing". Anything you leave unmarked still loads at once. If you load your tags through Tag Manager, the Consent Mode v2 guide covers that route.

4. Test it as a stranger

Open the site in a private window and look at the cookies in your browser’s developer tools before you answer: none of your optional ones should be there. Press Reject all, reload and check again. Then accept, check that they appear, and press Cookie settings to see that the choices reopen.

Does your platform already have a banner? Most do, with fewer options and often without holding every tag back: see the guides for Shopify, Wix and Squarespace, or the general guide to adding a cookie banner to your website. You will also want a cookie policy for the banner to link to.

Questions

Cookie banners, before you ask.

Pick a starting point, choose which categories you ask about (Preferences, Statistics, Marketing), edit the words, then copy the code into the head of your site, above every analytics and ad script. Then mark each of your own tags with type="text/plain" and data-bfc set to its category, so the banner can hold it back until the visitor allows it. The code is one style block and one script, with no plugin and no account.

Only for scripts you mark. The banner cannot see which scripts your site loads: it releases the ones carrying type="text/plain" and a data-bfc category once that category is allowed, and every other tag runs as it always did. The ICO says you cannot set non-essential cookies on your website's homepage before the user has consented, so mark every analytics and ad tag and test in a private window with Reject all.

No. A banner is one part: what your site sets, what your cookie policy says and what happens to the data afterwards are still yours to decide. The EDPB's cookie banner taskforce describes its own positions as a minimum threshold that does not amount to a green light from an authority, and says national rules still apply. The checks here look for the mistakes that report and the ICO name; they cannot tell you the site is compliant. This is general information, not legal advice.

On the first screen, yes, as far as the taskforce report goes: a vast majority of authorities considered a banner with a consent button but no refuse option on any layer not in line with valid consent, and it says a refusal offered only as a link with too little visual support does not lead to valid consent. The generator puts Reject all beside Accept all in the same style. It lets you turn that off so you can see the check flag it, but we recommend leaving it on.

After a choice, a small Cookie settings button stays on every page, and any link or button with the attribute data-bfc-open reopens the choices as they left them, so you can also put a link in your footer. The taskforce report says withdrawing consent must be possible at any time and as easy as giving it. If a visitor withdraws a category whose scripts already ran, the page reloads once so they stop, but cookies those scripts set stay until they expire.

With "Send Google consent signals" on, the code sets ad_storage, ad_user_data, ad_personalization and analytics_storage to denied before anything else, with a wait_for_update of 500 milliseconds as in Google's own example, and updates them when the visitor chooses. Google says the default must come before any command that sends measurement data, so the banner has to sit above your Google tag, and that you are responsible for making the defaults match your policy. Our Consent Mode v2 guide covers the Tag Manager route.

No. The banner is built in your browser and nothing you enter is sent to our servers. The banner you publish stores one first-party cookie, bfc_consent, that holds the names of the categories the visitor allowed, with no visitor ID and nothing sent to a server. List it wherever you document your cookies: the cookie policy generator takes it as an entry.

All three pages were opened on 19 November 2026. The EDPB report was adopted on 17 January 2023 and describes itself as a minimum threshold, not a green light; the ICO page says it is based on the previous version of the detailed cookies guidance; Google’s page was last updated on 13 October 2026. The generated code, the defaults, the starting-point wording and the checks marked as ours are ours; the facts about Builderify Cookie Consent come from our own Cookie Consent page and guides. ← All free tools

Stop losing the visitors
you already paid for.

More leads from the traffic you already have, and follow-up that sends itself. Free to start. No card, no monthly fee.