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.
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()
}) 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.
Last updated