Your job on the page
Write the visitor’s decision to the JavaScript global named in your settings. The default iswindow.__consent.
window.__consent = true. The tag reads the value like this:
The full documented shape is
{ analytics, marketing, necessary, version }. Only analytics is read. The others are accepted and ignored, so writing the whole object now is safe.
The tag walks the signal path property by property from
window, so window.__consent, __consent, and window.myCmp.state.consent all work. A path with a function call or an operator in it does not, because the path is never run as code.OneTrust
C0002 and C0004 are the defaults, but they’re editable.
Cookiebot
Anything else
Set the provider to Custom, keep the signal source as it is, and write the same object from your own banner’s callbacks.What the tag does, precisely
With No tracking before opt-in on, which is the default:- A denial sticks for that page load. A later yes doesn’t restart it. A real visitor who changes their mind gets a fresh tag on their next page load, which is why this is acceptable — and it means pre-decision browsing is never delivered late, which is the point.
- Nothing is lost on a yes. Everything held is sent, so a page view that happened before the banner was answered still arrives.
- What’s held is finite. On a page that fires a great many events before consent is answered, the oldest are dropped.
- Silence eventually gives up. If your platform never writes the value — wrong path, banner that never loads — the tag holds, then quietly stops. This is the “nothing is recorded, no errors” case.
The gating matrix
Why forms aren’t gated
A submission is an explicit action by the visitor. Form processing rests on a different lawful basis from analytics consent, and refusing a lead because someone declined analytics cookies would be the wrong behaviour. What forms do carry is the evidence: the exact consent statement the visitor was shown, stamped onto the record by allGood rather than supplied by the page. See Keep evidence of what visitors agreed to.A landing page that allGood hosts is tracked only by the tag it loads, so the gate applies there exactly as on your own site. Serving the page records no view and sets no
_ag_id. A hosted page that doesn’t load the tag isn’t tracked at all, and publishing it shows a warning.The identity cookie
It proves a browser reached an allGood surface before. It does not prove anyone consented, which is why the two checks are separate.