Most banners ask, then hope. Cookie Rocks follows your page from the server to the visitor’s browser. It switches trackers off, switches them on after a yes, and after a no, erases what got through.
Scroll: one page load, frame by frame. A real one takes under two seconds; this one waits for you.
- 1 · 0 ms
Your server answers
The tracker’s cookie never leaves
The page starts as a reply from your server. If that reply wants to set a cookie for a tool that is not allowed yet, Cookie Rocks Pro switches the header off before it leaves. Here, the Meta Pixel’s _fbp.
Not sent - 2 · 120 ms
The page leaves
Trackers are switched off in the page
Every script Cookie Rocks recognises stays in the page, turned into plain text. The browser reads it like a note on the fridge: it does not run it, it does not even download it.
<script type="text/plain" data-cr-category="statistics" src="https://www.googletagmanager.com/gtag/js">From a cache? Same result. WP Rocket, Cloudflare or your host keep the page as it left: switched off. The visitor’s choice is read in their browser, never on your server, so one cached page fits every visitor.Off - 3 · 230 ms
The browser opens the page
Cookie Rocks starts first, your site runs
In the browser, Cookie Rocks starts before the other scripts. Your theme and your own scripts run as usual: the menu, the cart, the fonts. Only the trackers wait.
Your site runs - 4 · 1.3 s
A script arrives late
The late one is switched off too
A tag manager adds a known tool after the page has loaded. Nice try: it is switched off too. Cookie Rocks watches what is added, not only what was there at the start.
Off - 5 · 1.6 s
The visitor sees the banner
Nothing written, nothing moves
The page is complete and usable. The banner floats over it, so nothing moves. And look at the storage: nothing is written. No tracker ran, so there is nothing to erase and nothing to explain.
Cookie Rocks adds 1.13 kB to each next page, and 0 layout shift. Speed, measured
Where refusing is enough, as in many US states, these tools run from the start, and a refusal cuts them off and erases them: see frame 7.
Nothing written - 6 · 2.2 s
The visitor says yes
Switched on, right there
The scripts that were off switch on, in the order of the page, on the same page, without a reload. They write their cookies and keys, as they should.
On - 7 · 2.2 s, or any day after
The visitor says no, or changes their mind
Erased, in all four places
Cookies, local storage, session storage, IndexedDB: all four places, at once, then after 5 and 20 seconds, because some tools write again a moment later. Cookie Rocks comes back too. One cookie stays, crocks_consent: it remembers the no.
Erased, three times - 8 · Any time
A tool nobody knows yet
What it does not know, it cannot switch off
Cookie Rocks recognises 842 tools by name. It is good, not psychic: a tool it has never seen runs. That is why the free Audit lists every script from another domain that it does not recognise, for you to check.
Names nobody has identified yet
Unknown
What does your site let through before the yes?
Why it matters
Most banners stop at blocking. Cookie Rocks also erases what was already written, in all four places a browser keeps data.
Banners block only part of what loads. By default, most do not erase what was written before a visitor refuses or changes their mind, and the ones we tested leave browser storage alone.
Cookie Rocks does both. It switches recognised tools off before the choice, so nothing is written. Then it erases what slipped through: cookies, local storage, session storage, IndexedDB. IndexedDB databases have no end date: erasing one matters more than erasing a cookie that expires next month.
Kept on purpose: the cookie that remembers the choice. Erasing it would undo the refusal. The limit stays the same: only recognised tools, a list that grows with every harvest of real sites, IndexedDB databases included.
| A banner that only blocks | Cookie Rocks | |
|---|---|---|
| Cookiesexpire one day | Stay | Erased |
| Local storageno end date | Stays | Erased |
| Session storageuntil the tab closes | Stays | Erased |
| IndexedDBno end date | Stays | Erased |
- 842tools recognised by name, switched off until the visitor says yes
- 4places erased after a no: cookies, local storage, session storage, IndexedDB
- 3passes: at once, after 5 seconds, after 20 seconds
- 248jurisdictions: each visitor gets their own country’s rule
Under the hood
Four mechanisms, for the curious and for developers. None of them needs a setting: they work as soon as the plugin is on.
One pass on the finished page
When WordPress has built the page, Cookie Rocks reads it once and switches off every script it recognises, in the HTML itself. A page cache then stores this version, so cached pages are covered too.
<!-- before -->
<script src="https://connect.facebook.net/en_US/fbevents.js">
<!-- after -->
<script type="text/plain"
src="https://connect.facebook.net/en_US/fbevents.js">Scripts added later
Tag managers and widgets add scripts after the page has loaded. In the browser, Cookie Rocks watches the scripts that appear and switches off those of known tools, until their category is allowed.
// added at 1.3 s by another script
document.head.append( oneSignalScript );
// known tool, category not allowed: switched offCookies set by your server
Some tools set their cookie from the server, in the reply itself, before any script runs. Cookie Rocks Pro removes these headers for the names it recognises, until the visitor says yes.
HTTP/2 200
set-cookie: _fbp=fb.1.1732… ← not sent before the yesCookie Rocks ProErasing, three times
After a no, or when a visitor withdraws a yes, Cookie Rocks erases the names of the refused categories in cookies, local storage, session storage and IndexedDB: at once, then after 5 and 20 seconds, for tools that write again a moment later. It keeps crocks_consent, the cookie that remembers the choice.
0 s _ga, _fbp, _gcl_ls, _hjSession_… erased
5 s hjViewportId erased
20 s nothing leftBuilding a plugin or a theme?
A consent tool can only switch off what it sees, when it sees it. Load your scripts at the right moment, and every consent tool can hold them, Cookie Rocks or another.
- Be in the pageEnqueue your script with WordPress. A loader written inline, that nobody recognises, slips past.
- Not too earlyNothing that writes a cookie or a key while the page is read. If it must stay inline, mark it with its category.
- Decide in the browser, not in PHPThe page is cached: PHP answers for the first visitor only. Read the choice in JavaScript, and listen for changes.
- Optimisers: leave held scripts aloneA script of type text/plain stays as it is: never combined, never delayed into life.
See what your site lets through today
The free Audit opens your pages as a new visitor and lists every tracker that runs before the yes, and the ones Cookie Rocks would switch off.
gtag/js · Google Analyticsruns
fbevents.js · Meta Pixelruns
widget.js · not recognisedto check
menu.js · your themefine
Read more: Browser storage, How long cookies last, Known cookies, Does Reject change anything?