# Handle applicable consent requirements

- Check 41.07 · Tracking and analytics setup · Critical
- Source: https://checklist-seo-geo.com/en/tracking-analytics-setup/handle-applicable-consent-requirements
- List your trackers, add a compliant banner, block what must be blocked and pass consent on to GA4, Tag Manager and Matomo on your CMS.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/tracking-analytics-setup/handle-applicable-consent-requirements.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

Handling consent means applying the rules of your visitors' country to the site's cookies and trackers: exempt ones run freely, the others wait for the visitor's explicit agreement, and the analytics tool receives the state of that consent. In France and the European Union, this requires a banner that lets visitors accept or refuse with the same ease. Once this is done, no tracker subject to consent fires before the visitor chooses, and measurement remains usable despite refusals.

This guide describes the technical implementation. It does not replace the advice of a lawyer or of your data protection officer.

## Why it matters

In France, article 82 of the French Data Protection Act (loi Informatique et Libertés), which transposes the European ePrivacy Directive, requires prior consent before a tracker is placed on or read from the visitor's device, except where exemptions apply. The CNIL (the French data protection authority) sets out the rules: as long as the person has not consented, the cookies concerned can be neither placed nor read; accepting and refusing must be equally easy; withdrawing consent must be as easy as giving it; and the site must be able to prove the consent it collected. The CNIL regularly carries out inspections and imposes penalties on this subject.

A poorly connected banner also costs data: analytics tool blocked even after acceptance, landing page never measured, signals never passed on to Google.

Google also requires sites to obtain consent and to pass its state on. To serve personalized ads in the European Economic Area (EEA), the United Kingdom and Switzerland, AdSense, Ad Manager and AdMob require a Google-certified consent management platform (CMP) integrated with the IAB's TCF.

## What it improves

- **Compliance**: trackers conditional on the visitor's choice, proof of consent kept.
- **Measurement quality**: with Google's Consent Mode in its advanced version, GA4 receives cookieless signals from visitors who refuse and fills part of the gaps through modeling.
- **Trust**: a clear, honest banner is better received than a deceptive one.
- **Performance**: blocking scripts until the visitor has chosen lightens the first load. See [test before and after cookie consent](https://checklist-seo-geo.com/en/performance-core-web-vitals/test-before-after-cookie-consent).
- **Rankings**: no direct effect. A banner that hides the content can, however, hinder reading and the measurement of Core Web Vitals.

## How to check

Private window, developer tools open (Network and Application > Cookies tabs), then three journeys:

1. **Arrival without a choice**: no cookie subject to consent (`_ga`, `_fbp`, `_gcl_au`…) and no request to advertising domains.
2. **Refusal**: same result, and the banner does not come back on the next page.
3. **Acceptance**: the cookies appear and measurement is sent without reloading the page.

Also check the banner itself: a refuse button at the same level as the accept button, a link to the detailed purposes, a permanent way to change one's mind (a “Manage cookies” link in the footer).

For GA4, Tag Assistant shows the consent state of each event. The full checking method is in [check data collection](https://checklist-seo-geo.com/en/tracking-analytics-setup/check-data-collection).

## How to implement

### Step 1 — List the trackers

Crawl or browse the site with the developer tools open, and list every cookie and every third-party script. Deliverable: a tracker register. Example (to adapt; it is not a legal assessment):

| Tracker | Provider | Purpose | Consent required? | Lifetime |
|---|---|---|---|---|
| Session cookie, cart | Site | Operation | No, strictly necessary | Session |
| Cookie storing the banner choice | Site or CMP | Operation | No | Duration of the choice |
| `_ga`, `_ga_<ID>` | Google Analytics 4 | Audience measurement, data sent to Google | Yes | Up to 2 years by default |
| `_pk_id` | Matomo configured according to the CNIL's conditions | Exempt audience measurement | No, under conditions | 13 months recommended |
| `_fbp` | Meta | Advertising | Yes | Set by Meta |
| Embedded video player | YouTube | Playback and tracking | Yes, in general: load it on click | Set by Google |

For audience measurement, the CNIL allows an exemption from consent if the tracker is used solely for audience measurement on behalf of the publisher only, produces anonymous statistics, and allows neither cross-referencing with other processing nor tracking across sites. It also recommends informing visitors, limiting tracker lifetime to 13 months and data retention to 25 months. GA4 is not among the solutions you can automatically consider exempt: check with the provider, using the CNIL's self-assessment tool.

### Step 2 — Choose the banner

| Solution | Type | Suited to |
|---|---|---|
| Platform's native banner | Shopify, Wix, Squarespace | Sites on these platforms with few third-party tools |
| Complianz, CookieYes, Cookiebot | Plugins and CMPs | WordPress, brochure sites and stores |
| Axeptio, Didomi, Cookiebot, OneTrust | Commercial CMPs | High-stakes, multi-country and advertising sites |
| tarteaucitron.js | Open-source French script | Custom sites, Laravel, Symfony, Next.js |

Require: “Accept all” and “Reject all” buttons at the same level, choice by purpose, real prior blocking of scripts, integration of Google's Consent Mode, a consent log, and Google certification if you serve personalized ads through AdSense, Ad Manager or AdMob.

### Step 3 — Choose Google's Consent Mode

| Mode | How it works | Consequence for GA4 |
|---|---|---|
| Basic | Google tags do not load before the visitor chooses | Nothing is sent in case of refusal; general modeling only |
| Advanced | Tags load with a default “denied” state and send cookieless signals | No cookie before agreement; GA4 uses these signals to model part of the missing data |

Four parameters control advertising and measurement: `ad_storage`, `ad_user_data`, `ad_personalization` and `analytics_storage`. Choosing between basic and advanced is as much a legal decision as a technical one: advanced mode sends requests, without cookies, before any consent. Have it approved.

Without a CMP that handles Consent Mode for you, set the default state before the Google tag:

```html
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('consent', 'default', {
    'ad_storage': 'denied',
    'ad_user_data': 'denied',
    'ad_personalization': 'denied',
    'analytics_storage': 'denied',
    'wait_for_update': 500
  });
</script>
<!-- Google tag (gtag.js) next -->
```

Then, in your banner's acceptance callback, send the update matching the accepted purposes (here, audience measurement only), and send it again whenever the choice changes:

```js
gtag('consent', 'update', {
  'analytics_storage': 'granted',
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied'
});
```

`wait_for_update` gives the banner 500 milliseconds to pass on an already stored choice before the tags fire.

### With Google Tag Manager

1. `Admin > Container Settings`: turn on the consent overview.
2. Add your CMP's tag from the Community Template Gallery, on the **Consent Initialization - All Pages** trigger, which fires before all others.
3. Google tags (Google tag, Google Ads, Floodlight) have built-in checks: they read the consent state on their own.
4. For every other tag (pixels, heatmaps), `Advanced Settings > Consent Settings > Require additional consent for tag to fire`, and add the required type (`ad_storage` for an advertising pixel).
5. Preview the three journeys, then publish.

### With Matomo

Two routes:

- **Exemption**: configure Matomo according to the CNIL's conditions (IP address anonymization, no user ID, no cross-referencing, limited durations) and load it without waiting for the banner. Mention it in the privacy policy.
- **Consent**: ask for it before any tracking.

```js
var _paq = window._paq = window._paq || [];
_paq.push(['requireConsent']);
_paq.push(['trackPageView']);
// … rest of the Matomo tracking code

// In the banner's acceptance callback:
_paq.push(['rememberConsentGiven']);

// When consent is withdrawn:
_paq.push(['forgetConsentGiven']);
```

`requireConsent` blocks requests and cookies; `requireCookieConsent` sends requests but waits for agreement before setting cookies. `rememberConsentGiven` stores the agreement in the `mtm_consent` cookie: calling it once is enough.

### WordPress

Versions: WordPress 6.4 and later; Complianz, CookieYes, Cookiebot, WP Consent API and Site Kit by Google, November 2026 versions.

1. Install a banner plugin (Complianz, CookieYes or Cookiebot) and run its wizard, which scans the site and blocks the scripts it recognizes.
2. Install WP Consent API, which passes the choice on to compatible plugins.
3. If GA4 goes through Site Kit: `Site Kit > Settings > Admin Settings`, turn on Consent Mode. Site Kit applies it to visitors from the EEA, Switzerland and the United Kingdom.
4. If GA4 goes through Tag Manager, connect the CMP's template in GTM instead and turn off script insertion by the plugin.

### Shopify

Versions: Shopify admin, all plans, November 2026.

`Settings > Customer privacy > Cookie banner`. Publish a privacy policy first. Keep the automatic settings or choose the regions manually (EEA, United Kingdom, Switzerland), then the appearance and position. Shopify's banner governs the pixels managed by Shopify, including the Google & YouTube channel. Scripts added by hand in the theme or by apps may escape it: check them, or use a third-party CMP compatible with Shopify's Customer Privacy API, keeping the same regions on both sides.

### Wix

Versions: Wix dashboard, November 2026.

Turn on the built-in cookie banner in the privacy settings, with a reject button, and put each custom code snippet in its consent category.

### Squarespace

Versions: Squarespace 7.1, November 2026.

`Cookies & visitor data` panel: turn on the banner, type “Opt in & out”. Scripts added through Code Injection need your own consent logic.

### Webflow

Versions: Webflow, all site plans, November 2026.

Use a third-party CMP loaded in `Site settings > Custom code`, first in Head code, and have GA4 or GTM come after it with a default “denied” state. Check that no native integration injects a tag before the CMP.

### PrestaShop

Versions: PrestaShop 8 and 9.

Install a consent management module from PrestaShop Addons or one from a CMP (Axeptio, Didomi, Cookiebot), compatible with your version. Check that the Google Analytics module and the advertising modules wait for consent, then test the checkout.

### Drupal

Versions: Drupal 10 and 11.

The COOKiES, Klaro or EU Cookie Compliance modules display a banner and block scripts by category. With the Google Tag module, turn on its Consent Mode support if your version offers it, or handle it in Tag Manager.

### Laravel

Versions: Laravel 11 to 13.

At the top of the layout's `<head>`, in this order and inside a `@production` block: a partial containing the default state from step 3, the CMP script (tarteaucitron.js or a commercial CMP) with its configuration, then the Google tag. The CMP configuration calls `gtag('consent', 'update', …)` in its acceptance and refusal callbacks, as described in its documentation.

### Next.js

Versions: Next.js 15 and 16 (App Router).

```tsx
// app/layout.tsx
import Script from 'next/script';
import { GoogleAnalytics } from '@next/third-parties/google';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="fr">
      <body>
        <Script id="consent-default" strategy="beforeInteractive">
          {`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied',
  'wait_for_update': 500
});`}
        </Script>
        {children}
      </body>
      <GoogleAnalytics gaId="G-XXXXXXXXXX" />
    </html>
  );
}
```

The client-side banner component calls `window.gtag('consent', 'update', …)` when the visitor chooses and stores that choice.

### Step 4 — Keep proof and review

- **Proof**: the CNIL expects you to be able to demonstrate consent. Keep the CMP's log and dated screenshots of each version of the banner and its configuration.
- **Cookie policy**: publish the up-to-date register from step 1, accessible from the banner and the footer.
- **Review**: with every new tool, redo the inventory and the three journeys. Plan a check at least once a year.
- **Measurement**: document the share of refusals and its effect on the figures. See [document the limits of attribution](https://checklist-seo-geo.com/en/tracking-analytics-setup/document-limits-attribution).

## Common mistakes

- **No reject button on the first layer**, or a refusal hidden behind “Settings” while acceptance takes one click.
- **Decorative banner**, the most frequent case: the choice is requested, but scripts fire before it or despite a refusal.
- **Pre-ticked boxes** or consent inferred from continued browsing.
- **Landing page not measured after acceptance**: the tag waits for the next page, and the source of the visit is lost.
- **Two competing systems** (Shopify's native banner and a third-party CMP) with different regions: data are sent before the choice in some countries.
- **Consent Mode not passed on**: GA4 and Google Ads receive no signal, and modeling cannot work.
- **Believing Matomo is exempt by nature**: the exemption depends on its configuration.
- **Never updating the register** after adding a chat, a video or a pixel.

## Frequently asked questions

### Do I need a cookie banner if I only use Matomo?

Not necessarily. The CNIL exempts from consent audience measurement trackers that serve only the publisher, produce anonymous statistics and allow neither cross-referencing nor tracking across sites. Matomo configured this way can run without a banner, with a simple notice in the privacy policy. As soon as another tracker subject to consent is present, a banner becomes necessary again.

### Can Google Analytics 4 work without consent?

In the European Union, GA4 sets cookies and sends data to Google: it must wait for consent. With advanced Consent Mode, tags load with a denied state and send cookieless signals, which GA4 uses to model part of the unmeasured visits. This choice to send requests before consent must be approved by your lawyer or data protection officer.

### What is the difference between basic and advanced Consent Mode?

In basic mode, Google tags load only after the visitor chooses: in case of refusal, nothing is sent to Google, not even the consent state. In advanced mode, they load as soon as the page opens with a default denied state and send cookieless signals, which allows Google to build modeling specific to your site. Advanced mode recovers more data.

### How long should audience measurement cookies be kept?

For audience measurement trackers exempt from consent, the CNIL recommends a lifetime of 13 months at most, with no automatic extension on each visit, and retention of the collected data for 25 months at most. These durations must be reviewed periodically. For other trackers, align the lifetime with the purpose and state it in your cookie policy.

## Resources

- [CNIL (French): cookies and trackers, what does the law say?](https://www.cnil.fr/fr/cookies-et-autres-traceurs/regles/cookies/que-dit-la-loi)
- [CNIL (French): solutions for audience measurement tools](https://www.cnil.fr/fr/cookies-et-autres-traceurs/regles/cookies-solutions-pour-les-outils-de-mesure-daudience)
- [Google: Consent mode overview](https://developers.google.com/tag-platform/security/concepts/consent-mode)
- [Google: Set up consent mode](https://developers.google.com/tag-platform/security/guides/consent?hl=en)
- [Tag Manager Help: Consent settings](https://support.google.com/tagmanager/answer/10718549?hl=en)
- [AdSense Help: Certified CMP requirement](https://support.google.com/adsense/answer/13554116)
- [Matomo: Tracking consent](https://developer.matomo.org/guides/tracking-consent)
- [Site Kit: Consent Mode](https://sitekit.withgoogle.com/documentation/using-site-kit/consent-mode/)
- [Shopify Help: Cookie banner](https://help.shopify.com/en/manual/privacy-and-security/privacy/customer-privacy-settings/privacy-settings)

Next steps: [check data collection](https://checklist-seo-geo.com/en/tracking-analytics-setup/check-data-collection) and [document the limits of attribution](https://checklist-seo-geo.com/en/tracking-analytics-setup/document-limits-attribution).
