On this page
What this issue is
A cookie banner groups scripts into categories. Visitors choose which categories to allow. Your tags only respect that choice if each tag is filed in the right category.
This issue happens when a tag lands in the wrong one. Two common cases: GA4 filed as Necessary, so it runs even after a visitor rejects analytics. Or GA4 filed as Marketing, so it only runs when the visitor accepts ads cookies, and analytics goes quiet for everyone who accepted only analytics.
| Tag or cookie | Usual category | Common mistake |
|---|---|---|
| GA4 (_ga, _ga_*) | Analytics / Statistics | Necessary or Marketing |
| Google Ads conversion and remarketing | Marketing / Advertising | Analytics |
| Meta Pixel (_fbp) | Marketing | Analytics |
| Session or cart cookie | Necessary | Marketing |
| The CMP's own consent cookie | Necessary | Left uncategorised |
Why it costs you leads or sales
A wrong category hurts in two directions.
Tag too strict (Marketing instead of Analytics): visitors who accept analytics only are never measured. Your reports undercount sessions and conversions, and you may cut a channel that is actually working.
Tag too loose (Necessary instead of Analytics): the tag fires after a reject. That can breach privacy rules, and a complaint or audit can force you to switch tracking off entirely. The same slip with ad tags can also pass data to ad platforms without consent.
Example: 1,000 visitors accept analytics only. With GA4 wrongly filed as Marketing, none are recorded.
How to check if your site has it
Open a clean browser window
Use a private window with extensions off, so no old consent cookie is stored.
Open DevTools
Press F12, go to the Network tab, tick Preserve log and filter for 'collect' (GA4 requests go to google-analytics.com/g/collect).
Reject everything
Load the page and click Reject all. If a collect request appears, analytics is filed too loosely.
Accept analytics only
Repeat in a new private window and allow only Analytics or Statistics. If no collect request appears, analytics is filed too strictly, probably as Marketing.
Review the CMP cookie list
In your CMP dashboard, open the cookie or script list and look at the category set for _ga, _ga_*, _gid, _fbp and _gcl_*.
Check tag manager consent settings
In Google Tag Manager, open the tag, go to Advanced Settings, then Consent Settings, and compare the required consent types with the CMP categories.
How to fix it
Fix the category in the CMP first, then make sure your tag manager asks for the matching consent type. Menu names differ by CMP, so look for words like Cookies, Scripts, Categories or Purposes.
Open the GA4 tag
Go to Tags, open your GA4 configuration or event tag, then Advanced Settings and Consent Settings.
Require analytics_storage
Choose 'Require additional consent for tag to fire' and add analytics_storage. Do not add ad_storage to a GA4 tag.
Match ad tags to ad consent
Google Ads and Meta tags should require ad_storage (and ad_user_data, ad_personalization where offered).
Preview and publish
Use Preview mode, check the Consent tab for each choice, then publish.
Open your consent plugin
In the plugin's settings (for example under Settings or the plugin's own menu), find the cookie or script list.
Recategorise the cookie
Set _ga and _ga_* to Analytics or Statistics. Set _fbp and ad cookies to Marketing.
Check analytics plugins
If a plugin such as a GA4 or SEO plugin adds the tag, make sure the CMP blocks that script in the same category.
Clear caches
Clear page and CDN cache so the updated banner config loads.
Check the consent app or Customer Privacy settings
Go to Settings, then Customer privacy, and review the banner and region settings. If you use a third-party consent app, open its cookie list.
Review pixel permissions
In Settings, then Customer events, open each pixel and check its Permission and Data sale settings. Analytics pixels should need Analytics consent, ad pixels Marketing.
Re-test checkout
Run the test again through to checkout, since checkout pixels run in a sandbox.
Find where the tag is added
Check Project settings, then Integrations (Google Analytics) and Custom code, as well as page-level embeds.
Match the CMP category
If your CMP needs script attributes, mark the analytics script with the analytics category. Attribute names depend on the CMP, so use its documentation.
Publish and retest
Publish the site, then test Reject and Accept-analytics in private windows.
Set defaults before tags load
Call gtag('consent','default',...) before any Google tag, with analytics_storage denied until the visitor chooses.
Send the right update
On Accept analytics, call gtag('consent','update',{analytics_storage:'granted'}) only. Grant ad_storage only when Marketing is accepted.
Remove hard-coded tags
Delete any analytics snippet pasted directly into templates that bypasses the CMP.
// Run when the visitor saves their choice (adapt names to your CMP)
function onConsentSaved(choice) {
gtag('consent', 'update', {
analytics_storage: choice.analytics ? 'granted' : 'denied',
ad_storage: choice.marketing ? 'granted' : 'denied',
ad_user_data: choice.marketing ? 'granted' : 'denied',
ad_personalization: choice.marketing ? 'granted' : 'denied'
});
}How to confirm it's fixed
- Reject all: no GA4 collect request and no _ga cookie are created.
- Accept analytics only: GA4 collect requests appear, ad tags stay silent.
- Accept all: GA4 and ad tags all fire.
- GTM Preview shows analytics_storage granted only after the analytics choice.
- GA4 Realtime shows your test visit after Accept, and not after Reject.
- The CMP cookie list shows no analytics cookie under Necessary.
How to prevent it happening again
Rescans and plugin updates can reset categories. Build a small routine around them.
- Review the CMP cookie list after every automatic scan or CMP update.
- Lock or manually override categories for _ga, _ga_*, _fbp and _gcl_*.
- Re-test Reject and Accept-analytics after adding any new tag or plugin.
- Keep a written map of tag, category and consent type for your team or agency.
- Run a scheduled check so a regression is noticed within a day, not at month end.
How FunnelGuard handles this
FunnelGuard detects this only partly. It runs your real customer journeys on a schedule and checks that the tracking hits to GA4, Google Ads, Meta, TikTok, LinkedIn and other platforms actually arrive. If a wrong category blocks a tag, so the expected hit goes missing on a journey, FunnelGuard can flag the missing tag, send one alert after a second-region re-check, and attach a screenshot and a likely cause.
Questions people ask
Why is my GA4 not tracking after I added a cookie banner?
A common cause is that GA4 is filed under Marketing or another category the visitor has not accepted, so the CMP blocks it. Check the category set for _ga and _ga_* in your CMP, and the consent settings on the GA4 tag in Google Tag Manager. Then test with Accept analytics only.
Should Google Analytics be set as a necessary cookie?
Usually no. Analytics cookies such as _ga are normally treated as optional and put in an Analytics or Statistics category that needs consent. Filing them as Necessary means they run even after a reject. Confirm your approach with your privacy adviser.
How do I change the category of a cookie in my CMP?
Open your CMP dashboard, find the cookie or script list (often under Cookies, Scripts or Categories), select the cookie and change its category. Save, publish the banner config and clear caches. Then retest Reject and Accept in private windows.
Why does my cookie scanner put cookies in the wrong category?
Scanners match cookie names against a database and guess when a cookie is unknown or shared by several services. Google cookies are often lumped together. Review results manually and override any wrong category after each scan.
How do I test if analytics fires after rejecting cookies?
Open a private window, open DevTools Network tab, reject all in the banner and filter requests for 'collect'. If a request to google-analytics.com appears, analytics is firing without consent. Also check that no _ga cookie was set.
What consent type should the GA4 tag require in GTM?
GA4 should require analytics_storage. Ad tags such as Google Ads and Meta should require ad_storage, plus ad_user_data and ad_personalization where available. Set this under Advanced Settings, then Consent Settings, on each tag.
Can FunnelGuard tell me if my CMP categories are wrong?
Only partly. FunnelGuard checks that expected tracking hits arrive on your journeys, so a tag blocked by a wrong category can show up as a missing hit. It does not audit your CMP category list or judge legal correctness, so you still need the manual checks.
Related issues
- TRK-282Consent banner shown but tags fire before any choiceFix guide
- TRK-283Tags still fire after visitor rejectsFix guide
- TRK-284Consent Mode v2 not implemented (no gcs/gcd)Fix guide
- TRK-288Consent update never sent after AcceptFix guide
- TRK-299Google-certified CMP not used (required for EEA ads)Fix guide
- TRK-303Cookies set before consent (_ga, _fbp)Fix guide