Repository navigation
Read GPP consent from the IAB's UserDefaults keys - #86
Merged
Merged
Conversation
The SDK read the GPP string from IABGPP_2_TCString, which is not an IAB key, so a spec-compliant CMP's string was never found. It never read the section IDs either, so gpp went out without gpp_sid unless the app set it. Read IABGPP_HDR_GppString (keeping IABGPP_2_TCString as a fallback) and IABGPP_GppSID, converting the CMP's "2_7" to the Edge API's "2,7". The CMP's section IDs are only used with the CMP's GPP string; an explicit config.gppSid still wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mosherBT
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The IAB GPP spec has in-app CMPs store the GPP string under
IABGPP_HDR_GppStringand the applicable section IDs underIABGPP_GppSID(underscore-separated, e.g.2_7). The SDK readIABGPP_2_TCString, which isn't an IAB key, and never read the section IDs. With a spec-compliant CMP, nogppwas sent, andgpp_sidwas never sent unless the app setconfig.gppSid.What Changed
IABConsent.gppTCreadsIABGPP_HDR_GppStringfirst and falls back toIABGPP_2_TCString, so apps that write the old key keep working.IABConsent.gppSidreadsIABGPP_GppSIDand converts2_7to2,7, the comma-separated form the Edge API takes (same as the web SDK and the Android docs).EdgeAPI.buildEdgeAPIURLuses the CMP's section IDs only when the GPP string also came from the CMP, as gdpr/gdprConsent are paired. An explicitconfig.gppSidstill wins. Aconfig.gppwithoutgppSiddoesn't pick up the CMP's IDs, which may belong to a different string.OptableConfigdoc comments forgpp/gppSidname the right keys and link the GPP spec.How to Test
bundle exec fastlane testspasses (104 tests locally)EdgeAPITests: spec keys givegpp+gpp_sid=2,7; the old key still works; an explicitconfig.gppignores the CMP's section IDs.Notes
Apps with a spec-compliant CMP will now send
gpp/gpp_sidwhere they sent nothing before.Document OptableConfig options and consent signals #79 documents the old behavior (
IABGPP_2_TCString, "noUserDefaultsfallback" forgppSid). Its docs need updating once one of the two merges.The Android SDK reads the same non-IAB
IABGPP_2_TCStringkey.Breaking change
Requires release
🤖 Generated with Claude Code