"The pixel didn't fire for me." Before you open Tag Manager, find out what that person actually agreed to. On any site running OneTrust, the answer is sitting in a cookie.
Find it
Press F12, open the Application tab and look under Cookies for your domain. Two cookies start with Optanon:
| Cookie | What it holds |
|---|---|
OptanonConsent | The visitor's choices, plus when and where they were made |
OptanonAlertBoxClosed | The date the visitor closed the banner. While it exists, the banner stays hidden. |
Decode the choices
The value of OptanonConsent is long and URL-encoded. Paste this into the Console to make it readable:
decodeURIComponent(document.cookie.match(/OptanonConsent=([^;]+)/)[1])
Look for the part that starts with groups=:
groups=C0001:1,C0002:1,C0003:0,C0004:0
1 means allowed and 0 means refused. This visitor said yes to strictly necessary and performance cookies, and no to functional and targeting. On a default setup, that's analytics on and advertising off, so a missing Meta Pixel is the system working.
Two other fields are worth knowing. datestamp is when the choice was saved. geolocation shows the country and, in the US, the state OneTrust used to pick its rule, for example US;CA.
Three questions it answers
First, what the visitor allowed: the groups value.
Second, which rule they got. A colleague in Hyderabad testing through a VPN in Germany will get the European opt-in rule and see far fewer tags than they expect. The geolocation field tells you which rule OneTrust applied.
Third, whether they answered at all. No OptanonAlertBoxClosed cookie means the banner was never closed. In Europe that means the defaults still apply, so almost nothing will fire.
Cookie or variable?
The cookie is the saved choice. OnetrustActiveGroups is what OneTrust is using on the page right now. They should agree once OneTrust has loaded. If GTM Preview shows a tag reading an empty or different value, the tag most likely ran before OneTrust loaded, and its trigger needs to wait for the OneTrustLoaded event.
Three Console shortcuts
OneTrust.IsAlertBoxClosed() // has the visitor answered?
OneTrust.getGeolocationData() // which country and state OneTrust sees
OneTrust.ToggleInfoDisplay() // open the settings panel
Next time someone reports a tag that didn't fire, ask them to run the decode line and paste the result. It takes thirty seconds, and often saves you a screen-share.
