How to Fix a Missing Cookie Consent Banner for Tracking Tags
Your site loads analytics or advertising tags (Google Analytics 4, Google Tag Manager or the Meta Pixel), but no cookie-consent tool was detected. By the end of this guide you will have a consent management platform (CMP) installed, your tags will wait for opt-in, Google Consent Mode v2 will be configured, and you will have confirmed that nothing tracks before a visitor agrees.

Why it matters
Under GDPR and the ePrivacy Directive, non-essential cookies and similar identifiers need prior consent from visitors in the EU, EEA and UK. Regulators such as the CNIL and the ICO have fined sites for loading trackers before consent or for hiding the Reject option. Since March 2024, Google requires Consent Mode v2 signals for EEA traffic.
Without them, remarketing audiences and conversion modelling in Google Ads and GA4 stop working for those users. A clear banner with an equal Reject option also builds trust, and the opt-in data you do collect is lawful to use.
What you need
Step-by-step fix
Inventory every tracking tag on the site
Open example.com in a private window and view the page source. Search for these markers:
gtag/js?id=G-for GA4googletagmanager.com/gtm.js?id=GTM-for Google Tag Managerfbq('init'orconnect.facebook.netfor the Meta Pixel
Also check the tags inside your GTM container (Tags list) and any plugin or app that injects tracking. Write down each tag, its ID and its purpose (analytics or marketing).
Choose a CMP that supports Consent Mode v2
Pick a consent management platform that does three things: blocks scripts before consent, sends Google Consent Mode v2 signals, and is on Google's list of certified CMPs if you run Google Ads or AdSense in the EEA/UK. If you sell programmatic ad inventory, also require IAB TCF v2.2 support. Create an account, add example.com as a domain, and run the CMP's cookie scan so it can sort the cookies into Necessary, Preferences, Statistics and Marketing.
Load the CMP script first in the <head>
Paste the CMP snippet as the very first script in the <head> of every page, above GTM, gtag.js and the Meta Pixel. The banner can only block tags that load after it. The example below uses Cookiebot's auto-blocking mode; other CMPs provide an equivalent snippet in their dashboard under Installation or Implementation.
<head> <!-- 1. Consent tool first --> <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="00000000-0000-0000-0000-000000000000" data-blockingmode="auto" type="text/javascript"></script> <!-- 2. Then GTM / gtag.js / Meta Pixel --> </head>
Set Google Consent Mode v2 defaults to denied
Before any Google tag loads, declare default consent states so GA4 and Google Ads stay cookieless until the visitor opts in. Many CMPs inject this automatically; check your CMP settings for a 'Google Consent Mode' toggle. If yours does not, add the snippet below directly after the CMP script.
})` with 'granted' values when the visitor accepts.
<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',
functionality_storage: 'denied',
personalization_storage: 'denied',
security_storage: 'granted',
wait_for_update: 500
});
</script>Gate non-Google tags on consent in GTM
In GTM, go to Admin > Container Settings and tick Enable consent overview. Then open Tags, click the shield icon, and set each tag's Additional Consent Checks.
- Meta Pixel and other ad tags: require
ad_storage - Hotjar, Clarity and similar analytics: require
analytics_storage
If the Meta Pixel is hard-coded rather than in GTM, revoke consent before init and have your CMP's accept callback grant it.
<script>
fbq('consent', 'revoke');
fbq('init', '000000000000000');
fbq('track', 'PageView');
// In your CMP's 'marketing accepted' callback:
// fbq('consent', 'grant');
</script>Configure the banner to meet consent rules
In your CMP dashboard, set the banner up so that:
- Accept all and Reject all sit on the first layer with equal size and prominence
- No category except Necessary is pre-ticked
- The banner links to your cookie policy at example.com/cookie-policy
- A persistent 'Cookie settings' link (usually in the footer) lets visitors withdraw consent as easily as they gave it
Publish the configuration and clear any page or CDN cache.
<a href="#" onclick="Cookiebot.renew(); return false;">Cookie settings</a>
Test consent behaviour and re-run the audit
Open example.com in a fresh private window, then check each of the following:
- Before clicking: DevTools > Application > Cookies should show no _ga, _gid, _fbp or _gcl_au cookies.
- After Reject: reload and confirm the same cookies are still absent.
- After Accept: they should appear. In the Network tab, requests to google-analytics.com/g/collect should carry
gcs=G111after Accept andgcs=G100before it.
Finally, re-run the audit to confirm a consent tool is now detected.
// Run in the DevTools console window.google_tag_data && google_tag_data.ics && google_tag_data.ics.entries
Platform-specific notes
WordPress
Install a CMP plugin such as Complianz, CookieYes or the official Cookiebot plugin. Prefer one that supports the WP Consent API so plugins like Site Kit respect consent. If GA4 is added via Site Kit, enable Consent Mode under Site Kit > Settings > Admin Settings. Clear caching plugins (WP Rocket, LiteSpeed) after setup.
Shopify
Go to Settings > Customer privacy > Cookie banner to enable Shopify's built-in banner, which uses the Customer Privacy API. Alternatively, use a Shopify-integrated CMP app. Tags added through the Google & YouTube app and the Facebook & Instagram app honour this consent. Custom pixels in Settings > Customer events need their permission set to 'Required' for marketing or analytics.
Wix
Turn on the built-in banner in Dashboard > Settings > Privacy & Cookies > Cookie banner. Custom code added under Settings > Custom code must be assigned a cookie category (Essential, Functional, Analytics or Advertising) so Wix blocks it until consent. Wix integrations for GA4 and the Meta Pixel are gated automatically.
Webflow
Paste your CMP snippet at the top of Site settings > Custom code > Head code and republish. A common free option is Finsweet Cookie Consent, which blocks scripts you change from type="text/javascript" to type="fs-cc" with an fs-cc-categories attribute. Any GA4 ID entered in Site settings > Apps & integrations bypasses this, so move it into GTM or the custom code instead.
Next.js
In the App Router, load the CMP in app/layout.tsx with next/script and strategy="beforeInteractive". Render the Consent Mode defaults inline before @next/third-parties' GoogleTagManager or GoogleAnalytics components. Do not rely on a React-rendered banner alone: it mounts after hydration, so tags in the <head> can fire before it appears.
Check that it worked
✅ How to verify
- In a private window, DevTools > Application > Cookies shows no _ga, _gid, _fbp or _gcl_au cookies before you interact with the banner, or after you click Reject.
- Google Tag Assistant's Consent tab shows the default states as 'denied' and the updated states as 'granted' only after Accept.
- The banner is visible on first load of the homepage and of an inner page. The CMP global (e.g. window.Cookiebot, window.__tcfapi or window.UC_UI) exists in the console.
- Re-running the site audit reports that consent management was found.
⚠️ Common mistakes
- Adding a cosmetic banner (a custom 'We use cookies' bar) that does not actually block GA4, GTM or the Meta Pixel, so tracking still fires on page load.
- Placing the CMP script below GTM or gtag.js, so tags execute before the consent default is set.
- Hiding Reject behind a 'Settings' layer or pre-ticking Statistics and Marketing. EU regulators consider neither valid consent.
- Loading the CMP only for EU IP addresses at server level, which means crawlers, audits and VPN users never see it, and EU visitors are missed when geolocation fails.
Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.
Check my site freeFAQ
Do I need a cookie banner if I only use Google Analytics 4?
Yes, for visitors in the EU, EEA and UK. GA4 sets _ga cookies and sends identifiers that are not strictly necessary, so ePrivacy rules require prior consent. Consent Mode lets GA4 send cookieless pings while consent is denied, but you still need a banner to collect the opt-in.
Is Google Consent Mode v2 the same as a cookie banner?
No. Consent Mode is a signalling API that tells Google tags how to behave. It does not display anything or record consent. You still need a CMP to show the banner, store the visitor's choice and send the 'update' command.
Do I need a banner if my site has no visitors from Europe?
Not under GDPR. However, US state laws (California CCPA/CPRA, Colorado, Connecticut and others) require opt-out mechanisms such as 'Do Not Sell or Share' links and honouring Global Privacy Control signals. Most CMPs can show a different banner per region.
Can I avoid a consent banner by using cookieless analytics?
Often, yes. Privacy-focused tools that set no cookies and store no personal data, such as self-hosted Matomo in cookieless mode, Plausible or Fathom, are generally treated as exempt in many EU countries. Your audit only requires a consent tool when GA4, GTM or the Meta Pixel are present. Removing those tags and switching to a cookieless tool also resolves the warning.
How to Set Up Google Consent Mode v2 Defaults on Your Site
How to Fix Legacy Universal Analytics (UA-) Tracking Code
How to Enable HTTPS and Redirect Your Site from HTTP
How to Fix Duplicate Analytics Tags (Google Tag Loaded Twice)
How to Fix the HTTP to HTTPS Redirect (301) on Your Site
How to Install Analytics on Every Page of Your Site