Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Cookie banner Accept button not closing: how to find and fix it

CNV-125High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A cookie or consent banner asks visitors to accept or reject cookies. When it works, clicking Accept stores the choice and hides the banner. In this issue, the click does nothing visible. The banner stays open, flickers back, or closes only after a second or third click.

Typical causes: a JavaScript error that stops the banner's click handler, another script or theme setting that interferes with the button, a caching or minify plugin that breaks the banner script, an invisible element sitting on top of the button, or a banner that saves consent but fails to hide itself.

Why it costs you leads or sales

A banner that won't close sits on top of your page. On mobile it can hide the form submit button, the add to cart button or the checkout. Visitors who can't get past it leave.

There is a quieter cost too. If the click is not registered, consent is not stored, so analytics and ad tags that wait for consent never fire. You lose conversion data and your ad platforms learn less from your traffic.

Where the visitor gets stuck
  1. Landing pageVisitor arrives and sees the banner
  2. Click AcceptBanner does not close
  3. Fill the formSubmit button is covered
  4. Lead or saleNever happens

The banner stays open after Accept, so everything behind it is out of reach.

Visitors who reach the formExample numbers
Visitors who reach the form (example)Banner closes on Accept: 60 %; Banner stays open: 25 %023466025Banner closes on Acce…Banner stays open%

Example: illustrative numbers only. A banner that stays open can cut how many visitors reach the form.

How to check if your site has it

Test the Accept button
  1. Open a clean session

    Use a private or incognito window so no consent choice is stored. Visit your landing page.

  2. Click Accept once

    Check that the banner disappears and does not return. Reload the page: it should stay closed.

  3. Test on mobile

    Repeat on a real phone or in your browser's device mode. Tap targets and overlays often differ on small screens.

  4. Open the browser console

    Press F12, open the Console tab and click Accept again. Red errors that appear at the click point to a broken script.

  5. Inspect what is under the click

    Right-click the button and choose Inspect. If the highlighted element is not the button (for example a transparent div), something is covering it.

  6. Try other browsers and ad blockers off

    Test in Chrome, Safari and Firefox, with extensions disabled, to see if the problem is browser specific.

How to fix it

Start with the cause the console points to. The most common fixes are below. If you recently changed themes, plugins, tags or caching settings, undo the latest change first and test again.

Fix by platform
  1. Exclude the banner script from optimisation

    In your caching or optimisation plugin, exclude the consent plugin's JavaScript from minify, combine and delay/defer options. Clear the cache and retest.

  2. Check for plugin conflicts

    Switch off other plugins one at a time, or use a staging site, to find one that breaks the banner. Update the consent plugin to its latest version.

  3. Run only one banner

    Make sure your theme, a page builder and a plugin are not all adding their own cookie banner.

Minimal Accept handler that stores consent and hides the bannerjavascript
document.addEventListener('DOMContentLoaded', function () {
  var banner = document.getElementById('cookie-banner');
  var accept = document.getElementById('cookie-accept');
  if (!banner || !accept) return;
  if (localStorage.getItem('consent') === 'granted') {
    banner.style.display = 'none';
    return;
  }
  accept.addEventListener('click', function () {
    try {
      localStorage.setItem('consent', 'granted');
    } catch (e) {}
    banner.style.display = 'none';
  });
});

How to confirm it's fixed

Confirmation checklist
  • In a private window, one click on Accept closes the banner.
  • The banner stays closed after a reload and on the next page.
  • No red errors appear in the console when you click.
  • Works on desktop and mobile, in Chrome and Safari.
  • Your form submit and checkout buttons are visible and clickable.
  • Tags that depend on consent now fire after Accept (check in your tag tool's preview mode).

How to prevent it happening again

Prevention habits
  • Test the banner after every theme, plugin, tag or caching change.
  • Keep only one consent banner active.
  • Exclude the banner script from minify and delay options.
  • Update the consent tool on a schedule and test after updates.
  • Run the journey on a schedule so you find out within a day, not weeks later.

How FunnelGuard handles this

FunnelGuard detects this issue only partly. Its robot visitor runs your journeys on a schedule and clicks the consent banner as part of the run. If the banner stays open and covers a button or form it needs, the step fails and the failure is seen as a covered call to action (CTA). You then get one alert, after a re-check from a second region, with a screenshot and a likely cause.

What it does not do: it does not specifically report that the Accept button did not close the banner when nothing else is blocked. A banner that stays open but leaves your CTA reachable, or one that closes but fails to store consent, is not flagged as this issue. It also does not test every browser, device or ad blocker setup, and it never bypasses bot protection.

To cover the rest by hand: test Accept in a private window on a real phone and a desktop browser, reload to check that the choice is remembered, and check in your tag tool's preview that consent-dependent tags fire after Accept. Do this after every change to your banner, theme or tags.

Questions people ask

Why is my cookie banner Accept button not working?

Most often a JavaScript error, a conflicting plugin or tag, or an optimisation setting that delays or minifies the banner script stops the click handler from running. Sometimes an invisible element sits over the button. Open the browser console and click Accept to see which error appears.

Why does my cookie banner keep coming back after I accept?

The banner is not saving the choice, or it cannot read it on the next page. Common reasons are blocked cookies or storage, a caching layer serving a stale page, or two banners running at once. Check that a consent cookie appears in your browser's storage after clicking Accept.

How do I fix a cookie banner that won't close on mobile?

Test on a real phone first. Look for an overlay or sticky element that covers the button, a layout that pushes the button off-screen, and console errors. Exclude the banner script from minify and delay options, and make sure only one banner is active.

Can a stuck cookie banner hurt my conversions?

Yes. It can cover forms, add to cart and checkout buttons so visitors cannot continue. It can also stop consent from being stored, so analytics and ad tags that wait for consent never fire.

Is it okay to hide the banner with CSS if Accept doesn't work?

No. Hiding it with CSS does not store consent, so tags that depend on consent may stay blocked, and it may not meet privacy rules. Fix the script or settings so the click saves the choice and closes the banner.

How do I know if a cookie banner is covering my form?

Open your page in a private window on desktop and mobile and try to reach and click the submit button. A synthetic monitor like FunnelGuard can also run the journey on a schedule and report a covered CTA with a screenshot.

Does FunnelGuard detect an Accept button that doesn't close the banner?

Only partly. It clicks the consent banner during journey runs and flags the failure when the open banner covers a CTA it needs. It does not separately report an Accept button that fails while nothing else is blocked, so test that by hand too.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: consent.ts clicks; failure seen as covered CTA.

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.