IAB GPP
The IAB Global Privacy Platform (GPP) is a single API that carries consent for
multiple privacy laws through one string and one interface. OptSens installs
window.__gpp and exposes the sections it supports.
What OptSens does on the wire
OptSens installs window.__gpp as a stub at page load, then upgrades it to
loaded when the configuration arrives. A __gppLocator iframe is created for
cross-frame access. The API answers these commands:
| Command | Returns |
|---|---|
ping | GPP version, CMP status, supported APIs, applicable sections |
addEventListener | Live updates as sections change |
removeEventListener | Detaches a listener |
hasSection | Whether a section is present |
getSection | The section string |
Sections
| Section | ID | When it is enabled |
|---|---|---|
TCF EU v2 (2:tcfeuv2) | 2 | IAB TCF mode is active |
US National (7:usnat) | 7 | CCPA / opt-out mode is active |
In TCF EU mode, GPP section 2 carries the same TC string produced by
IAB TCF. In CCPA mode, OptSens announces the US
National section as applicable and carries the sale and sharing opt-out in
the legacy __uspapi string described below.
Legacy __uspapi
For older US ad tech that calls window.__uspapi directly, OptSens installs a
thin wrapper plus a __uspapiLocator iframe. getUSPData returns a US Privacy
string in the 1YNN format, where the third character flips to Y when the
visitor has opted out of sale.
How to enable it
GPP follows the frameworks and region you already configure. There is no
separate GPP toggle. Section 2 turns on when you enable
IAB TCF. Section 7 and the __uspapi wrapper turn
on automatically for CCPA regions set in your
geo rules. See also
CCPA / CPRA.
How to verify it
Open your site and run this in the browser console:
window.__gpp('ping', function (data, ok) {
console.log(ok, data.cmpStatus, data.supportedAPIs, data.applicableSections);
});
To read the TCF EU section string:
window.__gpp('getSection', function (str, ok) {
console.log(ok, str);
}, '2:tcfeuv2');
On a CCPA page, check the legacy endpoint:
window.__uspapi('getUSPData', 1, function (data, ok) {
console.log(ok, data.uspString);
});
In CCPA regions, OptSens announces the US National section as applicable
and carries the sale and sharing opt-out in the __uspapi string.