Skip to content
FunnelGuard

Fix guide by FunnelsGuard

CMP categorises analytics tag wrongly: how to find and fix it

TRK-298Medium impactPartlyBy FunnelGuardPublished Updated
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.

Typical categories for common tags (check your own legal advice and CMP wording)
Tag or cookieUsual categoryCommon mistake
GA4 (_ga, _ga_*)Analytics / StatisticsNecessary or Marketing
Google Ads conversion and remarketingMarketing / AdvertisingAnalytics
Meta Pixel (_fbp)MarketingAnalytics
Session or cart cookieNecessaryMarketing
The CMP's own consent cookieNecessaryLeft 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.

Sessions recorded by analyticsExample numbers
Sessions recorded by analytics (example)Real visitors who accepted analytics: 1,000 sessions; Recorded (wrong category): 0 sessions; Recorded (correct category): 1,000 sessions03837671,00001,000Real visitors who acc…Recorded (wrong categ…Recorded (correct cat…sessions

Example: 1,000 visitors accept analytics only. With GA4 wrongly filed as Marketing, none are recorded.

How to check if your site has it

Test each consent choice by hand
  1. Open a clean browser window

    Use a private window with extensions off, so no old consent cookie is stored.

  2. 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).

  3. Reject everything

    Load the page and click Reject all. If a collect request appears, analytics is filed too loosely.

  4. 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.

  5. 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_*.

  6. 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.

Fix the category by platform
  1. Open the GA4 tag

    Go to Tags, open your GA4 configuration or event tag, then Advanced Settings and Consent Settings.

  2. Require analytics_storage

    Choose 'Require additional consent for tag to fire' and add analytics_storage. Do not add ad_storage to a GA4 tag.

  3. Match ad tags to ad consent

    Google Ads and Meta tags should require ad_storage (and ad_user_data, ad_personalization where offered).

  4. Preview and publish

    Use Preview mode, check the Consent tab for each choice, then publish.

Map each consent category to the right signaljavascript
// 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

Confirm after the change
  • 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.

Prevention routine
  • 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.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.