Reputation: 21
I tried to retrieve the GDPR consent string using postMessage inside an amp-iframe element but it simply doesn't work.
Is there a way to communicate with the CMP inside the amp-consent and amp-iframe ?
Thx
Upvotes: 2
Views: 806
Reputation: 11
Yes:
amp-consent caches and passes consent information to vendors via consentMetadata objects as well as a non-empty consentString. You can find and example of the consentMetadata object and its supported fields below.
{
"consentStringType": {enum} [1: TCF V1, 2: TCF V2, 3: US Privacy String] (optional),
"gdprApplies": {boolean} (optional),
"additionalConsent": {string} (optional)
}
Upvotes: 1