Google Consent Mode v2 instellen met AdSense: Technische Configuratiegids
Configureer Google Consent Mode v2 correct met je AdSense consent banner. Complete technische handleiding met kopieerbaar script, GTM instellingen en testprocedure.
Laatst bijgewerkt:
Google Consent Mode v2 is verplicht voor websites in de EU die Google Analytics of Ads gebruiken. In deze handleiding configureer je Consent Mode v2 correct met de gratis AdSense consent banner, inclusief een kopieerbaar script.
📌 Voor wie: Websites met de gratis AdSense 'Privacy & Messaging' banner als consent oplossing.
TL;DR: Kopieer het script uit Stap 2, plaats het BOVEN je GTM-code, en configureer je tags volgens Stap 3. Klaar.
Wat is Google Consent Mode v2?
Consent Mode v2 is Google's oplossing voor privacycompliant meten. Het vertelt Google-tags (Analytics, Ads) wat ze mogen doen op basis van gebruikerstoestemming.
De 7 consent parameters:
| Parameter | Functie |
|---|---|
ad_storage |
Cookies voor advertenties |
ad_user_data |
Gebruikersdata naar Google sturen |
ad_personalization |
Remarketing en gepersonaliseerde ads |
analytics_storage |
Analytics cookies |
functionality_storage |
Functionele cookies (bijv. taalvoorkeur) |
personalization_storage |
Personalisatie cookies |
security_storage |
Beveiligingscookies (altijd toegestaan) |
Met een correcte configuratie:
- Voldoe je aan de AVG/GDPR
- Behoudt je maximale data in Google Analytics
- Blijven je advertentie-inkomsten op niveau
Stap 1: AdSense consent banner configureren
Open je Google AdSense Dashboard en ga naar Privacy en berichten.
Controleer deze instellingen:
- ✅ AVG (GDPR) bericht actief
- ✅ Optie geselecteerd: "Toestemming geven, Geen toestemming geven, Opties beheren"
- ✅ TCF v2.2 ingeschakeld
- ✅ Banner gepubliceerd en zichtbaar op je website
Met deze instellingen stuurt je AdSense banner consent updates naar Google Tag Manager.
Stap 2: Default consent script plaatsen
Dit script definieert de standaard consent status voordat je banner laadt. Alle parameters starten op "Denied" (behalve security), zodat er geen data verzameld wordt zonder toestemming.
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Standaard: alles op denied, behalve security
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'functionality_storage': 'denied',
'personalization_storage': 'denied',
'security_storage': 'granted',
'wait_for_update': 500
});
</script>
Plaatsing in je <head>
De volgorde is cruciaal:
- Eerst: Dit consent script
- Daarna: GTM container code
<head>
<!-- 1. Consent defaults -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', { ... });
</script>
<!-- 2. GTM container -->
<script>(function(w,d,s,l,i){...})(window,document,'script','dataLayer','GTM-XXXX');</script>
</head>
Stap 3: GTM tags configureren
Google-tags hebben ingebouwde Consent Mode ondersteuning. Third-party tags niet.
| Tag type | Consent instelling | Waarom |
|---|---|---|
| GA4, Google Ads, Floodlight | No additional consent required | Ingebouwde consent check |
| Facebook Pixel, Hotjar, custom scripts | Require additional consent: ad_storage |
Geen ingebouwde check |
Voor Google tags (GA4, Ads):
- Open de tag in GTM
- Ga naar Advanced Settings → Consent Settings
- Selecteer No additional consent required
Voor third-party tags:
- Open de tag in GTM
- Ga naar Advanced Settings → Consent Settings
- Selecteer Require additional consent for tag to fire
- Voeg
ad_storagetoe (of de relevante consent type)
Stap 4: Configuratie testen
Open GTM Preview Mode en laad je website.
Test 1: Default consent
- Bij Consent Initialization staan alle parameters op "Denied"
- Alleen
security_storagestaat op "Granted"
Test 2: Na toestemming
- Klik "Akkoord" op je consent banner
- De parameters waar je toestemming voor vraagt springen naar "Granted"
Test 3: Tags vuren correct
- Google tags vuren pas na consent update
- Third-party tags vuren alleen als hun vereiste consent "Granted" is
Over functionality en personalization_storage
De AdSense banner stuurt updates voor:
ad_storagead_user_dataad_personalizationanalytics_storage
functionality_storage en personalization_storage worden niet door AdSense aangestuurd. Dit is normaal gedrag. Deze categorieën zijn bedoeld voor andere functionaliteit dan advertenties.
Belangrijk: Onder de GDPR vereist elke verwerkingscategorie afzonderlijke, expliciete toestemming. Je mag deze niet automatisch koppelen aan andere consent categorieën.
Veelgestelde vragen
Is Consent Mode v2 verplicht?
Ja. Sinds maart 2024 is dit verplicht voor adverteerders en Analytics-gebruikers in de EU. Een correcte configuratie zorgt voor:
- Volledige data in GA4 (via behavioral modeling)
- Optimale advertentie-inkomsten
- AVG-compliance
Werkt dit voor Cookiebot of OneTrust?
Deze handleiding is specifiek voor de gratis AdSense banner. Cookiebot en andere CMP's hebben eigen GTM-integraties met vergelijkbare functionaliteit.
Mijn tags vuren niet na toestemming
Controleer:
- Het consent script staat BOVEN je GTM code
- Je hebt je browser cache geleegd (of test in incognito)
- Je GTM container is opnieuw gepubliceerd
- Je AdSense banner is actief en gepubliceerd
Checklist: Consent Mode v2 Configuratie
Na deze handleiding:
- ✅ Default consent script geplaatst vóór GTM
- ✅ Alle parameters starten op "Denied"
- ✅ AdSense banner stuurt consent updates
- ✅ Google tags geconfigureerd zonder extra consent
- ✅ Third-party tags geconfigureerd met consent vereisten
- ✅ Alles getest in GTM Preview Mode
Je Consent Mode v2 configuratie is nu compleet en compliant.
Hulp nodig bij je consent setup?
Bekijk ook onze cases voor meer voorbeelden van technische implementaties.
