Articles

Cookie banners and pop-ups that trap AI agents

Usually fixed by: Developer · Typical effort: days

The first thing many AI agents see on a website isn't the home page. It's a cookie banner, a discount pop-up or a country selector sitting on top of it. A person closes it without thinking. An agent has to find the right button, work out what it means, and press it, and if it can't, the visit ends there. This guide covers the overlays that cause trouble, what AgentScore checks, and how to design them so they stay out of the way.

Why overlays stop AI agents

Browser agents, the kind that open a real browser and click through a site for someone, read a page through its structure and often a screenshot as well. An overlay that covers the page changes both. In the screenshot, the content is hidden or dimmed. In the page structure, a modal can make everything behind it unreachable until it's closed.

So the agent's first job is to get rid of it. That goes wrong in a few predictable ways:

  • No button it can recognize. A close control drawn as an icon with no text or label has no name, so the agent can't tell it apart from any other shape on the screen.
  • A fake button. A styled <div> or <span> that responds to a mouse click but isn't a real button. Many agents won't recognize it as something they can press.
  • Unclear choices. "Customize", "Learn more" and "OK" side by side, or a reject option hidden behind a settings screen. The agent may pick the wrong one or stall.
  • Overlays that come back. A pop-up that reappears on every page, or a second pop-up after the first is closed, costs the agent a step every time.
  • Something sitting on the main button. A chat widget or sticky banner placed over "Add to cart" means the agent's click lands on the wrong thing.

For the business, this is a quiet loss. The agent doesn't complain or fill in a feedback form. It tells the person it couldn't get through, or moves on to a site where it could.

What AgentScore checks

The AgentScore check is called "Pop-ups and banners can be dismissed by agents", and it's one of the higher-weighted checks in the Navigability category. It works like this:

  1. It opens your home page in a real browser at desktop size and waits for it to load.
  2. It looks for anything fixed to the screen (a pop-up, a banner, a drawer) that covers 15% or more of the visible window. A slim header bar along the top doesn't count.
  3. If it finds one, it reads the buttons and links inside it and looks for one with a clear dismiss label, such as "Accept", "Reject", "Decline", "Close", "Got it", "No thanks", "Continue" or a labelled ×.
What AgentScore findsResult
Nothing covers the page on arrivalPass
An overlay covers the page, but it has a clearly labelled button to close or answer itWarning: agents can get past it, but every one has to deal with it first
An overlay covers the page and has no clearly labelled way outFail

A second check, "Agents can find and press your add-to-cart or sign-up button", catches the other half of the problem. It finds the main button on a product or pricing page and tests whether something else, usually a pop-up, banner or chat widget, sits on top of it. If it does, the check fails, because an agent's click would land on the overlay instead.

This isn't about skipping consent. Where the law requires you to ask for cookie consent, keep asking. The goal is a banner that an AI agent acting for a person can answer as easily as the person could, not one that disappears. Talk to whoever owns privacy before changing what your banner asks or when.

The usual suspects

OverlayWhat tends to go wrongBetter approach
Cookie consent bannerFull-screen modal; icon-only close; reject hidden in settingsA bar at the bottom of the screen with "Accept all" and "Reject all" as real, named buttons side by side
Newsletter or discount pop-upAppears on arrival, covers the page, close button is a small unlabelled iconWait until someone has engaged; use a labelled "Close" or "No thanks"; don't show it on product or checkout pages
Country or region selectorBlocks the page until a choice is made, often with a custom dropdownA small, dismissible suggestion ("Shopping from Canada? Go to the Canadian store") and locale in the URL
Age checkCustom date pickers or a fake buttonWhere required, a short form with a native field and a real "Confirm" button
Chat widgetOpens itself on load, or its launcher covers buttons on smaller screensStart collapsed, keep the launcher small and clear of the main buttons
App install or promo bannerSticky and tall, pushing content down or covering itKeep it short, dismissible with a named button, and remember the choice

What an agent-friendly banner looks like

Here's a cookie banner that people, screen readers and AI agents can all handle. It sits at the bottom of the page, doesn't block what's behind it, and every choice is a real button with a plain name.

<div class="consent-bar" role="region" aria-label="Cookie choices">
  <p>We use cookies to run the store and, with your OK, to measure ads.
     <a href="/pages/cookies">Cookie policy</a></p>
  <button type="button">Reject all</button>
  <button type="button">Accept all</button>
  <button type="button">Choose cookies</button>
</div>

And the most common failure, the icon-only close button, fixed in one attribute:

<!-- An agent sees: button, no name -->
<button class="modal-x"><svg>…</svg></button>

<!-- An agent sees: button "Close" -->
<button class="modal-x" aria-label="Close"><svg aria-hidden="true">…</svg></button>

A few rules that make the difference:

  • Use real buttons with words. "Accept all", "Reject all", "Close", "No thanks". If the design calls for an icon, give it an aria-label.
  • Keep it to the edge. A bar along the bottom leaves the page usable. A centered modal over a dimmed page forces every visitor, human or agent, to deal with it first.
  • Make rejecting as easy as accepting. Several European privacy regulators have said this about cookie banners, and it also means an agent told to decline tracking can do so in one step.
  • Let Escape close it where closing is allowed, and return focus to the page afterwards.
  • Remember the answer. Once a choice is made, don't ask again on the next page.
  • One overlay at a time. Don't stack a discount pop-up on top of a cookie banner on the first page view.

Pop-ups and the pages that earn money

The home page is where AgentScore looks for overlays, but the pages that matter most are product pages, the cart and checkout. That's where a covered button costs a sale. Check those pages on a narrower screen too: a chat launcher that sits harmlessly in a corner on a laptop can land on top of "Add to cart" on a phone-sized window.

If marketing relies on an email capture pop-up, that's a reasonable trade-off to discuss rather than a rule to break. Showing it after someone has scrolled or spent time on the page, rather than on arrival, keeps most of its value for people and removes it from the first moment an agent arrives.

How to test it

  1. Open the site in a private window. That's what a first-time visitor and most agents see: no cookies, no remembered choices.
  2. Try to get past every overlay with the keyboard alone. Tab to the buttons and press Enter. If you can't reach the close button, or can't tell which control has focus, an agent will struggle too.
  3. Check the names. In Chrome's developer tools, the Accessibility pane shows each button's name. An empty name is a problem.
  4. Visit a product page and the cart at a narrow window size and make sure nothing covers the main button.
  5. Run AgentScore. It reports any overlay it found, how much of the screen it covered and which buttons it offered, and checks whether your add-to-cart or sign-up button is covered.

Overlays are one part of how agents find their way around a page. For the rest, see buttons, links and forms agents can use, and for the other thing that often greets agents on arrival, a CAPTCHA or bot challenge, see bot protection and CAPTCHAs. To see how agents handle the whole journey, not just the first screen, read how to test your key journeys with AI agents.

← All articles Test your site with AgentScore →

Can AI agents use your site?

Get your free AgentScore in under a minute. No sign-up needed.