Skip to content

Complianz: Reject clicked, but the GA4 cookies stay

Visitors deny statistics in Complianz, yet _ga cookies remain or come back. How to tell a leftover cookie from a live leak, and how to fix both.

Lukas Kontur · · 9 min read

A visitor clicks Deny on your Complianz banner. The banner closes, but in the browser the Google Analytics cookies _ga and _ga_ plus an ID are still there, or they come back on the next page. A scan reports "cookies still present after reject". This guide explains the two very different reasons for that, how to tell them apart in five minutes, and what to change in Complianz, Google Tag Manager or your plugins.

The symptoms

  • A scan report lists cookies still present after reject, usually _ga and _ga_ plus an ID, sometimes also trackers still active after reject with requests to google-analytics.com or /g/collect.
  • In your own browser, the Complianz consent cookie cmplz_statistics says deny, but _ga is still listed next to it.
  • _ga disappears when you clear cookies, then returns after you click Deny and open another page.

You are not the only one. When we clicked Reject on EU websites, 48.3% of the 22,445 sites with a conclusive test still had non-essential cookies after the reject flow (reject button study). That number covers all consent tools, not Complianz in particular.

There are two situations that look the same in a cookie list:

  1. A leftover cookie. _ga was set earlier (because the visitor accepted on a previous visit, or because a script leaked before the click) and is simply still stored. Nothing reads or updates it any more. Complianz documents this case: it "disables third-party scripts that set cookies prior to consent, and after a revoke", but "already set cookies are no longer useful, but cannot be removed on third-party domains" (Complianz: withdrawing consent). So by default Complianz stops the scripts; it does not promise to delete cookies.
  2. A live leak. A Google tag is still running after the Deny click and keeps writing _ga. This is the one to fix first, because data is still being sent.

The test below separates the two.

How to check it yourself

You need Chrome and about five minutes. Start from a clean visitor every time.

  1. Open a new private window (three-dot menu, "New Incognito window") and press F12 to open DevTools.
  2. In the Network tab, tick Disable cache so you see what a first-time visitor gets (Chrome DevTools: Network reference).
  3. Load your site and click Deny on the banner. Do not click anything else.
  4. Open Application, then Cookies and your site's address. Check cmplz_statistics (it should say deny) and look for _ga and _ga_. Complianz lists its own consent cookies, including cmplz_statistics, cmplz_marketing and cmplz_policy_id, in its developer guide. These are expected.
  5. Go back to Network, clear the list with the "clear" icon, type collect in the filter box and reload the page.
  6. Open a product page or another page and watch the list again.

Now read the result:

  • No _ga and no collect requests: Deny works for new visitors. If a scan still reports cookies after reject, it probably saw a cookie set before the click; read the next section.
  • _ga is there, but no collect requests appear after the reload: the cookie was set before the Deny click and is a leftover. Find out why it was set so early (cause 1 below).
  • collect requests appear after Deny and reload: a Google tag is still running. Click a request, open the Initiator tab and note which file started it. That file tells you which cause below applies.

For the returning-visitor case, open a new private window, click Accept, load a second page, then reopen your banner's consent settings (often a small "Manage consent" tab; the label depends on your setup), choose deny for statistics, and repeat steps 4 to 6.

Why it happens

In the order we see them most often:

  1. GA4 already ran before the click. If _ga exists right after you click Deny on a first visit, a script set it before the banner was answered. This is a pre-consent leak, and our Complianz not blocking GA4 or Meta Pixel guide covers it step by step: caching and optimisation plugins, services not enabled in Integrations, scripts Complianz does not recognise.
  2. The visitor accepted earlier and then changed their mind. Complianz blocks the scripts after a revoke, but leaves existing cookies in place unless you add cookie clearing (step 4 of the fix).
  3. GA4 is loaded by something Complianz does not control. A second analytics plugin, code in the theme, or a Google Tag Manager container whose GA4 tag fires on every page without a consent rule. The Deny click updates Complianz, but this copy of GA4 never asks.
  4. A cached page serves an old setup. Complianz warns that with caching, "cached scripts may serve an outdated version of the banner" (Complianz: caching and optimisation plugins). An old page can still contain a GA4 snippet you have removed elsewhere.
  5. Statistics are configured so that Complianz does not ask. In the Wizard's statistics questions, you tell Complianz how you use Google Analytics, for example whether IP addresses are anonymised and whether Google may use the data for other services (Complianz: statistics implementation). Depending on those answers and the visitor's region, Complianz may treat statistics differently. Its own older article on the topic says: "For some countries, like Germany, asking consent for Google Analytics is always needed." (Complianz: Google Analytics). Check what your version's Wizard shows; which option is right for your site is a legal decision, not a technical one.

The fix

Test again after each step, in a new private window.

Step 1: stop the leak before the click

If the first-visit test found _ga straight after Deny, work through Complianz not blocking GA4 or Meta Pixel first. Until nothing runs before the click, Deny cannot leave a clean browser behind.

Step 2: decide how Google tags behave after Deny

If Complianz adds the Google tag for you with Consent Mode V2 switched on, the Wizard (depending on your version) asks "Do you want to block all Google Tags before consent?". The default is No (Complianz: Consent Mode for 7.0).

  • No (advanced mode): Google tags load with the page and adapt to the consent state (same page). After Deny you will still see requests to Google. Google states that with analytics_storage denied, its tags "won't read or write first-party analytics cookies" and "send measurements without cookies" (Google: consent mode overview). So in this mode, collect requests after Deny are expected, but no new _ga should be written.
  • Yes (basic mode): Google tags are not loaded until consent. After Deny you should see no collect requests at all.

Choose deliberately and make sure your banner text matches what the site does.

  1. In Complianz, go to Integrations, Plugins, and see which analytics plugins are detected. If two plugins load GA4, keep one.
  2. If you use Google Tag Manager, tell the Wizard so ("Yes, and Google Tag Manager fires this script") and use the Complianz template from the GTM community gallery (search "Complianz"). Complianz's guide puts the template tag on the Consent Initialization - All Pages trigger (Complianz: Consent Mode v2 guide).
  3. In GTM, check each GA4 tag. If you do not rely on Consent Mode, fire it from the Complianz statistics event (cmplz_event_statistics) instead of "All Pages" (Complianz: importing the GTM container). Our GTM Consent Mode v2 guide explains the consent settings for each tag.
  4. Search your theme for gtag( and googletagmanager.com. Remove copies that duplicate what Complianz or GTM already loads, or ask your developer to do it.

Step 4: optionally clear old cookies after a revoke

Complianz says that from an ePrivacy point of view a site "is not obliged to remove the placed cookies", and that clearing them "does not change consent behavior or compliance efforts, but it might be a personal preference" (Complianz: withdrawing consent). If you want a clean cookie list after a revoke anyway, the same page links to a small must-use plugin that clears the cookies on your own domain, except the administrator cookies that keep you logged in. Complianz also notes that deleting cookies from someone's browser "can be considered invasive", so decide deliberately. Hand it to whoever maintains your site. Cookies on other domains, such as Google's or Facebook's, cannot be removed by your site.

Step 5: clear caches and re-test

Clear your caching plugin, your host's cache and Cloudflare if you use it. Exclude complianz and cmplz from minify, combine, delay and defer, as described in Complianz's caching guide linked above. While testing, Complianz suggests adding ?nocache to the address (Complianz: debugging issues).

How to verify the fix

Use a new private window for each run and keep Disable cache ticked:

  1. No click: no _ga or _ga_ cookie. No collect requests if you block Google tags; if you use advanced mode, collect requests may appear, but _ga must not.
  2. Deny, then reload, then a second page: still no _ga. In advanced mode, open Application, Cookies and confirm no _ga was added.
  3. Accept: _ga appears and collect requests are sent. This proves you did not switch off analytics for visitors who agree.
  4. Accept, then revoke via the consent tab, then reload: no new collect requests in basic mode. If you added cookie clearing in step 4, _ga is gone; otherwise it may stay as a leftover, but its Expires date in the cookie list should not move forward on each reload. A date that keeps moving means something is still writing the cookie.

Re-run this after every plugin, theme or GTM change.

Sample scan

78 / 100

High risk · Trackers: 23 · Pre-consent tracking: yes

See sample report →

Background: Pre-consent tracking explained. For the same problem on another consent tool, see Cookiebot: visitors click Deny, but tracking continues.

Check your site in 1 minute

Our free scan opens your site in a clean browser, clicks Reject, reloads the page and lists every cookie and tracker that is still active. No signup needed. Run a free scan.

Get alerted when it breaks

A plugin update or a new GTM tag can bring the leak back. With monitoring, we re-scan your site on a schedule and email you when cookies or trackers survive a Reject click again. The free plan includes one monitored site with a weekly re-scan and email alerts. Create an account and add your site.

Last updated: