Short answer: A cookie consent banner asks visitors before your site runs tags that track them, and remembers the answer. A good one offers its choices with the same weight, links to your policies and loads without blocking the page or moving it.
What a cookie banner does
Until the visitor answers, the tags that track people should stay off. Google’s consent mode handles this for Google tags in two ways.
In basic consent mode, Google tags don’t load until the visitor interacts with the banner, and if the visitor doesn’t consent, no data reaches Google at all. In advanced mode, the tags load with consent denied and send measurements without cookies until the visitor accepts.
Our Google consent mode guide shows how to set it up, and our privacy policy guide covers the page your banner links to.
Opt-out choices in California
California’s Attorney General explains that a business that sells or shares personal information must offer a “Do Not Sell or Share My Personal Information” link.
In California, visitors can also send the request with Global Privacy Control, a setting in some browsers or an extension. The Attorney General says covered businesses must honor it as a valid request to stop the sale or sharing of their data.
How to keep the banner from slowing your site
| What it can hurt | Why | What to do |
|---|---|---|
| Loading | A script that isn’t asynchronous blocks the parser and delays LCP | Load the banner script asynchronously |
| LCP on phones | A banner with a long block of text can be the largest element | Keep the text short |
| Layout shifts | Banners are a very common source of them | Show it at the bottom, over the page, without pushing content |
| Clicks after accepting | Accepting can start many third-party scripts at once | Spread that work out in small tasks |
| A banner from another domain | The browser needs a new connection first | Add preconnect or dns-prefetch for that domain |
From web.dev’s best practices for cookie notices, read November 4, 2026.
web.dev also suggests testing with the banner in each state: not answered, accepted and rejected. A test that only ever sees one state misses what the others cost.
How to set up a cookie banner
- List the cookies and tags your site uses and group them: necessary, analytics, marketing and functional.
- Keep every tracking tag off, or on consent mode’s denied defaults, until the visitor chooses.
- Offer the choices with the same weight, plus a link to your preferences and policies.
- Treat Global Privacy Control as an opt-out where the law asks for it.
- Load the banner script asynchronously, so it doesn’t block the page.
- Place the banner at the bottom, over the page, and make sure it never entirely hides the element with keyboard focus.
- Test the three states and check that no tag fires before the visitor’s choice applies.
The W3C asks that a focused element is never entirely hidden by content you add, banners included. Our keyboard navigation guide shows how to test it.
How our own banner works
Our notice sits at the bottom of the screen with two buttons in the same style. In the United States they read “Accept all” and “Do Not Sell or Share My Personal Information”. When the device’s time zone is in Europe or Brazil, the second reads “Reject all” and nothing tracks until the visitor answers.
Every page starts with Google’s consent defaults set to denied. Every tag stays switched off in the page until our script applies the visitor’s choice, or the opt-out default for a new visitor in the United States. A browser that sends Global Privacy Control keeps marketing off, even after an earlier “Accept all”.
On November 4, 2026, we stopped the notice script from blocking the page. We tested 12 visits before and after the change: new visitors in the United States and in Europe, and visitors who had accepted or rejected, on three pages.
In all 24, the consent defaults came first and no tag fired before the consent state was set. In Europe, none fired before the click on “Accept all”, and nothing on the page moved. PageSpeed Insights had listed the script among the files that block the first paint in 9 of 9 runs; afterwards, in none of 18.
Before you put a banner live
- Tracking tags stay off until the visitor’s choice applies.
- Both choices have the same weight.
- The banner links to your privacy and cookie policies.
- Global Privacy Control is honored where it applies.
- The banner script doesn’t block the page.
- Nothing moves when the banner appears.
RememberA banner is only as good as what happens behind it: test that the tags wait for the answer.
Banners, tags and consent are part of the websites our web design team builds.
Quick answers about cookie banners
What is a cookie consent banner?
A notice that asks visitors before your site stores cookies or runs tags that track them, and remembers their choice. It links to your privacy and cookie policies and lets people change their mind later.
Do I need a cookie banner?
If your site runs tags that track visitors, a banner is how you give them the choice. In California, a business that sells or shares personal information must offer a “Do Not Sell or Share My Personal Information” link.
Does a cookie banner slow down my website?
It can. web.dev says a script that isn’t asynchronous blocks the parser and delays LCP, banners often cause layout shifts, and accepting can add many third-party scripts at once. Each one has a fix.
What is Global Privacy Control?
A setting in some browsers, such as Firefox, DuckDuckGo and Brave, or an extension, that tells sites not to sell or share your data. California’s Attorney General says covered businesses must honor it as a valid opt-out request.
What is the difference between basic and advanced consent mode?
In basic consent mode, Google tags don’t load until the visitor answers the banner. In advanced mode they load with consent denied and send measurements without cookies until the visitor accepts.
Sources
Read on November 4, 2026. web.dev: Best practices for cookie notices. Google: Consent mode overview. State of California, Office of the Attorney General: California Consumer Privacy Act (CCPA). W3C: Understanding Success Criterion 2.4.11: Focus Not Obscured (Minimum). Our case: our own banner’s code and settings, a test of 24 visits and PageSpeed Insights, before and after the change.
