Code BLACKGO: cookie banner free for a year. Create an account →

Publications / Website audit

How to check whether a website sets cookies before consent

A self-test in the browser: private window, developer tools, cookies and network requests before consent, after rejection and after consent is withdrawn.

Author: Robert.S Published: Updated: 10 min read

How to check whether a website sets cookies before consent

A cookie banner can look correct while the website still starts Google Analytics or the Meta Pixel before the visitor clicks anything. Article 5(3) of the ePrivacy Directive – implemented in the national law of each Member State, e.g. § 25 TDDDG in Germany – requires consent before information is stored on or read from the device, except for what is strictly necessary. You can check this yourself in the browser, without extra software. Below we describe the test in Chrome and Firefox; in other browsers the tools look similar.

Preparation

  1. Close all private windows and open a new one (incognito). It has no cookies from earlier visits and no saved banner decision, so you see the website the way a new visitor does.
  2. Make sure no ad-blocking extensions are active in the private window – they stop some scripts and distort the result.
  3. Before you type the website address, open the developer tools: F12 or Ctrl+Shift+I (on a Mac Cmd+Option+I).
  4. Go to the Network tab. Tick “Preserve log” so that the list of requests does not disappear when you move to another page, and “Disable cache” so that the browser downloads the files again.
  5. Only now type the website address. Do not click anything in the banner.

If the website uses caching (cache plugins, CDN), clear the cache before the test so that you check the current version.

Step 1: cookies before a decision

In Chrome, open the Application tab and expand Cookies in the Storage section. In Firefox, it is the Storage tab and the Cookies entry. You will see a list of domains: your website’s address and possibly domains of other companies. Click each one and look through the cookie names.

Before a decision, strictly necessary cookies may appear: the session (e.g. PHPSESSID), the cart, form security. A warning sign is cookies from analytics and advertising tools, e.g.:

  • _ga and _ga_… – Google Analytics,
  • _gcl_au – Google Ads,
  • _fbp – Meta Pixel (Facebook),
  • _ttp – TikTok Pixel,
  • cookies starting with _hj – Hotjar.

Also check the Local Storage and Session Storage entries. According to EDPB Guidelines 2/2023, the consent rule also covers local storage, tracking pixels and browser fingerprinting – not only cookies. More about the guidelines: EDPB guidelines.

Step 2: network requests before a decision

A script can send data to another company even if it stores nothing in the browser, so check the network requests too. Go back to the Network tab and type parts of addresses into the filter field one by one:

  • googletagmanager.com – Google Tag Manager and the gtag script,
  • google-analytics.com – data sent to Google Analytics,
  • doubleclick.net and googleadservices.com – Google ads,
  • facebook.net and facebook.com/tr – Meta Pixel,
  • tiktok.com, hotjar.com, licdn.com – TikTok, Hotjar, LinkedIn,
  • youtube.com, google.com/maps and maps.googleapis.com – embedded videos and Google Maps.

Any such request before a click in the banner means that the service runs without consent. Embedded videos and maps count too: a YouTube frame connects to Google servers as soon as the page loads. Click a request to see which page and which script triggered it (the Initiator column in Chrome).

Go through several pages: the home page, an offer or product, contact (it often has a map), the blog (it often has videos), the cart. Scripts are sometimes added only on selected pages.

Step 3: what to check after clicking “Reject”

Close all private windows – only then does the browser delete their cookies – open a new one and repeat the preparation. This time click “Reject all”. Then:

  • check that only the cookie with the saved decision has been added and that none of the cookies listed in step 1 has appeared,
  • in the Network tab, clear the list of requests, reload the page and go through the same pages – there should be no requests to analytics and advertising services,
  • check that a placeholder saying the content is blocked appears in place of videos and maps,
  • see whether the banner comes back on every page – the decision must be remembered.

It is also worth doing the opposite test: in a new private window, click “Accept all” and check whether statistics and pixels start working. If they do not work even after consent, check which category the service is assigned to and whether its code is correct. Finally, accept only one category, e.g. Analytics, and check that the advertising pixels are still waiting.

Article 7(3) GDPR says that withdrawing consent must be as easy as giving it. After accepting everything, find the settings icon or the “Cookie settings” link in the footer and switch off the Marketing category. Save your choice, go to another page and check in the Network tab whether requests to facebook.net and similar addresses have stopped. Also see whether the cookies of the withdrawn service have stayed in the browser – that depends on the tool the website uses.

In the consetgo module, every change to a saved decision reloads the page, so withdrawn scripts stop immediately.

If the test showed a request or a cookie before a decision, click that request in the Network tab and check the Initiator column (in older Firefox versions: Cause). You will see which file triggered it – that is usually enough to find the cause.

What you seeMost common causeWhat to do
the request was triggered by gtm.jsa tag in the Google Tag Manager container fires without a consent condition, or GTM loads before consent without Consent Modecheck the GTM category in the consent tool and the consent settings of the tags in the container (GTM and consent)
the request was triggered by a plugin or theme filea plugin inserts its own script (statistics, chat, reviews, pixel)run the browser scan and assign a category to the service; assign an unknown address from the list of unrecognized hosts
after fixes in the website source, the old code is still therecaching: a cache plugin, the server or a CDNclear the cache and repeat the test in a new private window
requests to youtube.com, google.com/maps, vimeo.coma video or map embedded in the post content or in the templatecheck that a placeholder appears in their place before consent (YouTube, Vimeo and maps)
requests to a subdomain of your website (e.g. sgtm.yourdomain.com)server-side Google Tag Manager or a script served from your own domainassign the GTM container to the Marketing category so that the whole container waits for consent
the request was triggered by the website’s main JavaScript filethe tool’s code was built into the template files when the website was builtremove it from the files and add it through GTM or through the consent tool
the website has two banners or two consent scriptsan old cookie plugin runs next to the new toolkeep only one consent tool

After each fix, repeat the test in a new private window. We describe the full list of scenarios (refusal, analytics only, marketing only, withdrawal) in the article How to test GA4, GTM and pixels after changing consent settings.

How the consetgo scanner helps

A manual test shows the result, but on a larger website it is hard to check every page. In the consetgo module panel, the Scanner tab does this while you browse normally: you click “Enable scan mode”, then “Open the site in scan mode”, and go through a few pages. At the top of the page you see the orange scan mode bar with the number of detected resources. Blocking is then disabled only in your browser; visitors see the website unchanged.

Back in the panel, the scanner shows the services that really load, including tags added by Google Tag Manager. It knows more than 50 services. Addresses it did not recognise go to the list of unrecognized external hosts – until you assign them a category, the module blocks them as marketing. There is also a file scan for advanced users; it also finds code that never runs, so its results need checking.

After the scan and assigning categories, it is worth repeating the test from this article in a private window. If the panel shows the message “Limited mode — scripts are not blocked.”, the website is served from an HTML cache without running PHP. Exclude the pages from such a cache or use a cache plugin that runs PHP (WP Super Cache, W3 Total Cache and WP Rocket work, among others). More: How consetgo works and Features.

Checklist

  • Test in a new private window (after closing the previous ones), without ad-blocking extensions, with the website cache cleared.
  • Before a decision: no _ga, _gcl_au, _fbp, _ttp, _hj… or similar cookies.
  • Before a decision: no requests to googletagmanager.com, google-analytics.com, doubleclick.net, facebook.net or other analytics and advertising services. The exception is advanced Consent Mode: Google tags may load and send requests with the gcs=G100 parameter (all consents “denied”), but without the _ga and _gcl cookies.
  • Videos and maps do not load before consent.
  • “Accept all” and “Reject all” buttons on the first screen of the banner.
  • After rejection: only the banner choice is saved, no requests to tracking services on further pages.
  • After acceptance: the services work, each in its own category.
  • An icon or a footer link opens the settings at any time.
  • After consent is withdrawn, requests to the withdrawn service stop.
  • Test repeated on the home page, an offer, contact, the blog and the cart.

This test shows whether the website technically works the way the banner says. It does not assess the banner text or the privacy policy. We describe the requirements for the banner itself on the ePrivacy Directive page and in the questions and answers.

Questions and answers

Is a cookie saved before the click in the banner always a problem?

Strictly necessary cookies may work without consent, e.g. the session, the cart or remembering the choice made in the banner. The problem is cookies from analytics and advertising tools, such as _ga or _fbp.

Why does the test have to be done in a private window?

In a normal window the browser remembers earlier visits and the decision saved in the banner, so you do not see the website the way a new visitor sees it. When you close all private windows, the browser deletes their cookies, so the next test starts from scratch.

What should I do if a script loads despite rejection?

Find out where it comes from: the theme, a plugin or a tag in Google Tag Manager. In the consetgo module, run the browser scan again; a script that a plugin inserts in an unusual way can be added in the Tracking scripts tab as your own code.

Read also

How to document cookie consent and how long to keep the proof

How to document cookie consent and how long to keep the proof

Website audit

The GDPR requires the controller to be able to demonstrate consent, but does not say how long to keep the proof. What a consent log entry should contain, how to set the retention period and how to answer a question about a specific consent.

· 6 min read

Why reported conversions dropped after implementing a cookie banner

Why reported conversions dropped after implementing a cookie banner

Website audit

After a banner is implemented, GA4 and Google Ads show fewer visits and conversions. Usually this is the result of refusals, not a drop in sales. How to tell a change in measurement from a configuration error and what to check.

· 4 min read