On this page
Overview
Auto-blocking stops optional cookies being set until a visitor allows them on your banner. It works in the visitor's browser, using your cookie list to decide what to hold back. You turn it on or off with Auto-block cookies on the Settings tab of the Cookie Banner page.
Without Auto-blocking, CookieScan records each visitor's choice but does not stop cookies itself. Something else, such as Google Consent Mode in Google Tag Manager, then has to act on the choice.
Holding back optional cookies until a visitor agrees is one of the things cookie law asks of your website. See What cookie law asks of your website.
What Auto-blocking does
When a page loads, Auto-blocking checks the visitor's saved choice. Until the visitor allows a category, it does two things.
| What it blocks | How it decides |
|---|---|
| Scripts and embedded frames | It stops scripts and frames loading from the services your cookie list links to optional categories. |
| Cookies set by JavaScript | It only lets a cookie be written if its name is in an allowed category. |
Necessary cookies are always allowed. When the visitor allows a category, the cookies and scripts in that category can load. If Seamless consent (no page reload) is on, the choice applies straight away. If it is off, the page reloads to apply it. New websites start with it on.
Cookies from the same service are usually blocked or allowed together. If the scan put them in different categories, CookieScan treats them all as the most common optional category among them. A cookie you move to another category yourself keeps the category you chose.
Why your cookie list matters
Auto-blocking only knows the cookies in your cookie list. That has two effects.
- A cookie missing from your list is never allowed. If JavaScript on your website sets a cookie that is not in your list, Auto-blocking stops it, even after Accept all. That can break a feature that needs the cookie.
- A script from a service missing from your list is not blocked. Auto-blocking only holds back scripts from services in your list.
So keep your list complete. Scan again after you add a new tool, and add any cookie the scan missed. See Review and categorise cookies.
For a script of your own that a scan won't find, use the JavaScript API instead. See Load your own scripts after consent.
What Auto-blocking cannot block
Auto-blocking runs in the visitor's browser, after your install code loads. It cannot stop:
- cookies your server sends with the page, rather than ones JavaScript sets
- scripts placed above the CookieScan install code, because they run first
- tracking images and other requests that are not scripts or frames
- cookies already in the browser from an earlier visit
Put the install code first in your page's <head>, before any other scripts. Reject all does not delete cookies that are already set. See Cookies are still there after Reject all.
Auto-blocking does not run when your page is shown inside a frame on another page.
Exempt Statistics cookies
You can mark a Statistics cookie as Exempt. Auto-blocking then lets it be set before the visitor makes a choice. Visitors can still turn exempt cookies off on your banner, and Reject all turns them off. See Mark a Statistics cookie as Exempt.
Auto-blocking and Google Consent Mode
The two work in different ways, and you can use both.
| Feature | Auto-blocking | Google Consent Mode |
|---|---|---|
| How it works | Stops scripts and cookies in the browser. | Tells Google tags what the visitor allowed. Each tag decides what to do. |
| What it covers | Any service in your cookie list. | Google tags, and other tags you set up in Tag Manager to wait for consent. |
If you install CookieScan with Google Tag Manager, the install steps ask you to turn off Auto-block cookies. Tag Manager and Consent Mode then control your tags. See Install with Google Tag Manager and Set up Google Consent Mode. To compare the two install methods, see Choose how to install CookieScan.
If you stop using Consent Mode, keep Auto-block cookies on so tags still wait for consent. See Turn off Google Consent Mode.
Warning
If you turn off both Auto-block cookies and Use Google Consent Mode, nothing stops tags running before consent. The Settings tab shows a warning when both are off.
Turn Auto-blocking on or off
New websites start with Auto-block cookies turned on.
Open the Settings tab
Go to Cookie Banner, then Settings.
Change the setting
Tick Auto-block cookies to turn it on, or untick it to turn it off.
Publish the change
Select Save & Publish.
Websites where Auto-blocking is limited
Some website builders lock the parts of the browser that Auto-blocking relies on. On Wix, Auto-blocking cannot hold back scripts added by JavaScript or cookies set by JavaScript. See Install CookieScan on Wix.