Skip to content

Read GPP consent from the IAB's SharedPreferences keys - #49

Merged
jrosendahl-opt merged 2 commits into
masterfrom
fix/gpp-cmp-keys
Nov 10, 2026
Merged

jrosendahl-opt merged 2 commits into
masterfrom
fix/gpp-cmp-keys

Conversation

@jrosendahl-opt

@jrosendahl-opt jrosendahl-opt commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

The IAB GPP CMP API spec has in-app CMPs store the GPP string under IABGPP_HDR_GppString and the applicable section IDs under IABGPP_GppSID (underscore-separated, e.g. 2_7). The SDK read IABGPP_2_TCString, which isn't an IAB key, and never read the section IDs. With a spec-compliant CMP, no gpp was sent, and gpp_sid was never sent unless the app set OptableConsents.gppSid.

Same fix as the iOS SDK (Optable/optable-ios-sdk#86).

The IAB GPP CMP API spec has in-app CMPs store the GPP string under
IABGPP_HDR_GppString and the section IDs under IABGPP_GppSID
(underscore-separated). The SDK read IABGPP_2_TCString, which isn't an
IAB key, and never read the section IDs.

- Read IABGPP_HDR_GppString first, keep IABGPP_2_TCString as a fallback.
- Read IABGPP_GppSID and convert "2_7" to "2,7" for the Edge API.
- Use the CMP's section IDs only when the GPP string also came from the CMP.
- An explicit gppSid always wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tring

Blank SharedPreferences values are treated as unset, so the SDK no longer
sends `gpp=` or `gpp_sid=`, and a blank IABGPP_HDR_GppString falls back to
the legacy key. The CMP's section IDs are only sent with the CMP's own GPP
string, never with the legacy IABGPP_2_TCString value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jrosendahl-opt
jrosendahl-opt merged commit a0b96a5 into master Nov 10, 2026
3 checks passed
@jrosendahl-opt
jrosendahl-opt deleted the fix/gpp-cmp-keys branch November 10, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants