Cookie Consent Best Practices
Knowing the law is necessary. Implementing it well is where the real work happens. This section covers the practical best practices for cookie consent — how to build a consent experience that is legally compliant, technically sound, and respectful of your users.
1. Make Consent Genuinely Voluntary
GDPR Article 7(4) states that when assessing whether consent is freely given, "utmost account shall be taken of whether, inter alia, the performance of a contract, including the provision of a service, is conditional on consent to the processing of personal data that is not necessary for the performance of that contract."
In practice, this means:
- Do not use cookie walls that block content unless the user accepts all cookies. The EDPB has stated that cookie walls generally prevent consent from being freely given. If a user cannot access your website without accepting tracking, their "consent" is coerced, not voluntary.
- Do not degrade the experience for users who decline. Showing a persistent overlay, reducing page functionality, or displaying passive-aggressive messages ("We notice you have not accepted cookies — your experience may suffer") undermines the voluntary nature of consent.
- Offer genuine alternatives. If you use a "consent or pay" model, the paid alternative must be genuinely reasonable — not priced to punish refusal.
2. Eliminate Dark Patterns
Dark patterns in cookie consent are specifically targeted by regulators. The EDPB has issued guidance on deceptive design patterns, and the CNIL, Garante, and other DPAs have fined organizations specifically for manipulative consent interfaces.
Avoid these patterns:
- Asymmetric buttons. "Accept All" as a large, colorful button and "Manage Settings" as a small text link. Both options must be equally prominent. Several DPAs have specifically required that "Reject All" be available on the first layer with the same visual weight as "Accept All."
- Confusing language. "Continue without accepting" vs. "Accept and continue" — when both buttons look similar, users cannot quickly distinguish them. Use clear, unambiguous labels: "Accept All," "Reject All," "Customize."
- Hidden reject options. Requiring users to click through to a second or third layer to reject cookies, while "Accept All" is one click away. The CNIL fined Google EUR 150 million partly for this practice.
- Pre-checked toggles. Category toggles that default to "on" for analytics and marketing. The CJEU Planet49 ruling explicitly prohibits this.
- Misleading colors. Green for "Accept" and red or gray for "Reject" implies that accepting is the correct choice and rejecting is an error. Use neutral, consistent styling.
- Confirm-shaming. Language like "No thanks, I don't care about my experience" for the reject option is manipulative and undermines the voluntary nature of consent.
- Repeated prompting. Re-showing the consent banner on every page visit after the user has declined, hoping to wear them down. Once a user has made a choice, respect it.
3. Be Transparent
Informed consent requires that users understand what they are agreeing to. Transparency is not about volume of information — it is about clarity.
- Use plain language. "We use cookies to track your browsing behavior across the web for advertising purposes" is clear. "We leverage advanced data analytics technologies to enhance your personalized digital experience" is not.
- List all cookies. Your cookie policy should include a complete inventory: cookie name, provider, purpose, type (session/persistent, first/third-party), and expiration. This inventory must be kept current.
- Name third parties. If you share data with advertising networks, name them. "We share data with our advertising partners" is insufficient. "We share data with Google Ads, Meta (Facebook), and LinkedIn" is transparent.
- Explain the consequences. What happens if the user accepts analytics cookies? What happens if they decline? Users should understand the practical impact of their choice.
4. Offer Granular Control
GDPR requires that consent be "specific" — given separately for each purpose. Your consent mechanism should offer:
- Per-category toggles. Users should be able to accept analytics cookies while rejecting marketing cookies. The four standard categories (necessary, analytics, marketing, preferences) are the minimum.
- "Accept All" and "Reject All" shortcuts. While granular control is required, offering bulk options as shortcuts is both legal and user-friendly — as long as the granular option is equally accessible.
- Per-vendor control (recommended but not always required). For maximum transparency, consider allowing users to see and control cookies by vendor — for example, accepting Google Analytics while rejecting Hotjar, or accepting LinkedIn tracking while rejecting Facebook. Some consent management platforms call this "IAB TCF Level 2" granularity.
5. Make Withdrawal As Easy As Giving Consent
GDPR Article 7(3) is explicit: "The data subject shall have the right to withdraw his or her consent at any time. [...] It shall be as easy to withdraw as to give consent."
This requirement is frequently violated. Common failures include:
- No visible way to change cookie preferences after the banner is dismissed.
- A "Cookie Settings" link buried in the privacy policy, which is itself buried in the footer.
- Requiring the user to clear their browser cookies to reset preferences (this is not a withdrawal mechanism — it is a workaround).
Best practice implementations include:
- A persistent "Cookie Settings" link in the website footer.
- A small floating icon (often a cookie or shield icon) that reopens the consent manager.
- A section in the user's account settings (for logged-in users) where cookie preferences can be managed.
When a user withdraws consent, you must stop using the relevant cookies immediately. Delete the cookies from the browser and stop the associated scripts. Withdrawal must be effective, not just recorded.
6. Keep Records of Consent
GDPR Article 7(1): "Where processing is based on consent, the controller shall be able to demonstrate that the data subject has consented to the processing of personal data."
Your consent records should include:
- Timestamp of when consent was given or refused.
- Categories accepted and rejected.
- Version of the consent mechanism shown (what the banner looked like, what text was displayed). If you change your consent banner, you need to know which version each user interacted with.
- Method of consent (which button was clicked, what options were selected).
- Anonymized identifier linking the record to the device or session (not the user's name or email — the consent record itself should not become a privacy problem).
Store these records server-side. A client-side cookie alone is not sufficient proof — the user can delete it, and you have no independent record. Best practice is to log consent events to your server and retain them for the duration your data protection authority recommends (typically the same period as your cookie expiration, plus a reasonable buffer).
7. Re-prompt After Changes
Consent is specific to the purposes and cookies it was given for. If you add new cookies, new categories, new third-party vendors, or significantly change how you use existing cookies, previously collected consent may no longer cover the new processing.
Re-prompt users when:
- You add a new category of cookies that was not previously covered.
- You introduce a new third-party tracking service.
- You change the purpose of existing cookies (e.g., using analytics data for advertising purposes).
- A significant amount of time has passed since the last consent (the CNIL recommends no more than 13 months).
- Regulatory requirements change in a way that affects the validity of existing consent.
Implement a consent version system. Assign a version number to your consent configuration. When the version changes (because you added or modified cookies), re-prompt users who consented under a previous version.
8. A/B Test Consent Rates Ethically
It is legitimate to optimize your consent experience — testing different layouts, wording, and design to find what works best. But "works best" must mean "results in genuinely informed consent at a reasonable rate," not "maximizes accept-all clicks through manipulation."
Ethical A/B testing guidelines:
- All variants must be compliant. Every version you test must meet the legal requirements for valid consent. You cannot test a compliant version against a non-compliant version to see which gets more accepts.
- Test clarity, not manipulation. Does rewording the explanation increase understanding and thus consent? Does repositioning the banner improve engagement? These are legitimate tests.
- Do not optimize for "Accept All" rate. A high accept-all rate achieved through confusing design is not a success — it is a compliance risk. Optimize for the rate of users who make an active, informed choice of any kind.
- Monitor refusal rates. If a design change dramatically reduces refusals, ask whether it reduced them through clarity or through obstruction.
9. Technical Implementation Best Practices
The consent mechanism is not just a UI component — it requires proper technical implementation to actually work.
Block Scripts Until Consent
The most critical technical requirement: non-essential scripts must not execute until the user has consented to the relevant category. There are several approaches:
- Script type manipulation. Change
type="text/javascript"totype="text/plain"and add a data attribute indicating the category. When consent is given, a consent manager script changes the type back and triggers execution. - Tag manager integration. Use a tag manager (Google Tag Manager, Tealium, etc.) that supports consent modes. Tags are configured to fire only when consent for their category is present.
- Server-side rendering. Only include script tags in the page HTML if consent is already recorded (via a server-side check of the consent cookie). This is the most reliable approach but requires server-side logic.
Handle Consent State Correctly
- First visit (no consent recorded): Load only strictly necessary scripts. Show consent mechanism.
- Returning visit (consent recorded): Read the consent cookie. Load scripts matching accepted categories. Do not re-show the consent mechanism unless renewal is due.
- Consent withdrawn: Stop all scripts in the withdrawn category. Delete relevant cookies. Update the consent record.
- Consent renewed: Treat as a first visit for any new categories. Load previously accepted categories immediately.
Test Thoroughly
- Verify that no non-essential cookies are set before consent is given. Use browser developer tools (Application tab > Cookies) to check.
- Verify that scripts actually stop when consent is withdrawn — not just that the cookie is deleted, but that the scripts are no longer running.
- Test with JavaScript disabled. The consent mechanism should degrade gracefully, and no tracking scripts should load.
- Test on mobile devices. The consent mechanism must be fully functional and usable on small screens.
10. Use a Consent Management Platform (CMP)
Building a fully compliant consent mechanism from scratch is possible but involves significant ongoing maintenance. A consent management platform handles the complexity for you: consent collection, record-keeping, script blocking, geo-targeting, and regulatory updates.
When evaluating a CMP, consider:
- Automatic cookie scanning. Does the CMP detect all cookies on your site, or do you have to manually list them?
- Script blocking. Does the CMP actually block scripts before consent, or does it only display a banner?
- Consent records. Does the CMP store consent proof server-side?
- IAB TCF support. If you use programmatic advertising, TCF 2.2 support may be required.
- Performance impact. The CMP script loads on every page. How large is it? Does it block rendering?
- Customization. Can you match the consent banner to your brand's design?
- Accessibility. Is the consent mechanism itself accessible? Can it be navigated by keyboard? Does it work with screen readers? An inaccessible consent banner on a website that claims to care about accessibility is a bad look.
Passiro scans your website to identify all cookies and tracking technologies, categorizes them automatically, and provides actionable recommendations for your consent implementation — whether you build it yourself or use a CMP.
Summary: The Consent Checklist
A quick reference for evaluating your current consent implementation:
- No non-essential cookies are set before consent is given.
- The consent mechanism offers "Accept All" and "Reject All" with equal prominence.
- Users can make per-category choices (at minimum: necessary, analytics, marketing, preferences).
- The information presented is clear, specific, and in plain language.
- Pre-checked boxes and toggles are not used for non-essential categories.
- A persistent, easily accessible method exists to withdraw or change consent.
- Consent records are stored server-side with timestamps and category details.
- Consent is renewed at least every 13 months (or sooner if cookie usage changes).
- The consent mechanism is accessible (keyboard navigable, screen reader compatible).
- The implementation is tested regularly for compliance (new cookies, changed scripts).
Cookie consent done well is not an obstacle to your business. It is a foundation of trust between you and your users — and increasingly, it is what separates compliant businesses from those facing regulatory action.
Votre site web est-il conforme aux regles sur les cookies ?
Scannez votre site web gratuitement et trouvez tous les cookies en quelques minutes.
Scanner vos cookies gratuitement