How Cookie Consent Works
Cookie consent works by blocking non-essential tags before they run, showing the visitor a banner, and releasing those tags only if the visitor accepts. The order is the point: the blocking happens first, on page load, before any tracking fires. The banner then collects the choice, the consent tool stores it so the visitor is not asked again, and releases the accepted tags. The tool records each event so you can prove it.
A banner that appears after your analytics has already loaded achieves nothing. By then the cookies are set, and you have already broken the law.
The five steps
- Prior blocking. On load, the consent tool holds back non-essential scripts and cookies. Nothing beyond the exempt categories fires yet.
- The banner. The visitor sees an equal-prominence choice: accept, reject, or manage categories.
- Storing the choice. The consent tool saves the decision, usually in the browser, so the visitor is not re-prompted on every page.
- Releasing tags. If the visitor accepts a category, the consent tool lets the tools in that category run. If they reject, those tools stay blocked.
- Recording the event. The tool logs what the visitor saw and chose, so you can demonstrate consent. See how to prove cookie consent.
Where Consent Mode fits
Google tags get an extra layer. Google Consent Mode carries the choice to GA4 and Google Ads, so they adjust what they collect rather than being blocked outright. Blocking and Consent Mode work together: the blocking stops non-Google tags, and Consent Mode tells Google's tags how to behave. See the Google Consent Mode v2 guide.
Why prior blocking is the hard part
Getting the banner to look right is easy. Getting every non-essential tag to hold until consent, across a real site with tag managers and third-party scripts, is the engineering work that delivers compliance. Consentfolio blocks first, asks second, and sends Consent Mode v2 signals, all from one script tag. See cookie banner software and UK cookie law explained.
Frequently asked questions
What does "prior blocking" mean? The consent tool holds back non-essential cookies and tags on page load and releases them only after the visitor consents. It is the technical core of PECR compliance.
Where is the consent choice stored? Usually in the visitor's browser, so they are not asked again on every page. The consent tool also records the event on the server side so you can prove it.
What happens if a visitor rejects? The rejected categories stay blocked, so those cookies and tags never run. Only strictly necessary and exempt technologies continue.
Written by Tudor Rusmanica, founder of Consentfolio. Tudor has spent over a decade in agency SEO, working where search performance meets data protection: the analytics, tagging and consent setups that keep measurement useful and lawful. Connect on LinkedIn.
Published 13 July 2026. This guide is general information, not legal advice.
Consentfolio