Skip to Content

Opting Out

A visitor can tell Pushbroom to leave them alone, and it does.

There are two ways it happens: their browser says so, or they say so on your site.

Global Privacy Control

If a visitor’s browser sends Global Privacy Control, Pushbroom collects nothing from them and stores nothing on their device. No visit is minted, no page view is recorded, no custom event is sent.

Nothing is required of you. It works on every site running the script, and it worked before you read this page.

Pushbroom does not write that preference down anywhere, because it is not a choice we were told to remember — it is the visitor’s browser saying so on every request. Recording it would turn a setting they control into a note we keep about them.

The opt-out on your site

If you want to offer a control of your own, there are three calls.

window.pushbroom?.block()      // stop
window.pushbroom?.unblock()    // start again
window.pushbroom?.blocked      // true or false

A toggle is about as much code as that suggests:

<label>
  <input type="checkbox" id="pb-optout">
  Don't count my visits
</label>
const box = document.querySelector('#pb-optout')
box.checked = window.pushbroom?.blocked === true
box.addEventListener('change', () => {
  box.checked ? window.pushbroom?.block() : window.pushbroom?.unblock()
})

The ?. matters. The script is loaded async defer, so window.pushbroom may not exist when your code runs, and reaching through it without the guard throws.

Both calls take effect immediately. unblock() does not wait for a page load — the visitor toggles it back on and the current page is measured from that moment, which is what somebody who just changed their mind expects.

What “blocked” means

It means nothing is collected and nothing is kept.

A blocked browser never asks for a visit identifier, so none is minted and none is stored on the device. No page views are sent. pushbroom.event() does nothing and does not throw, so you do not have to check blocked before calling it. If your site adds elements to the page later, they are not counted either.

That is the strong version of the claim, and it is the one that is true: not “we ignore your data”, but “we never took it”.

What it does not do is reach backwards. Views recorded before the visitor opted out were written to storage when they happened, and blocking stops the next ones rather than removing those. If somebody opts out mid-visit, that visit stops growing.

Where the choice is kept

block() stores one value in the browser’s localStorage, under the key pushbroom:blocked. That is all it is: a flag, on their machine, saying not to collect.

unblock() removes the key rather than setting it to false, so a visitor who opts back in leaves no trace of ever having opted out.

Because it lives in localStorage, the choice is per browser and per site, like everything else here. It does not follow them to another browser, and it is not something we hold — we have no way to know that a given browser has opted out, only that it stopped asking.

If a browser refuses localStorage entirely — some sandboxed iframes and some Safari configurations do — Pushbroom treats that as not blocked and carries on, rather than failing shut in a way nobody can see or explain.

Read it yourself

All of this is a small and readable part of the collector, and the collector is published. The annotated source, comments and all, is at pushbroom.co/script.src.js. Look for blocked.

Last updated 2026.09.14