2

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

apo
  • 21
  • 4

1 Answers1

1

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)
}

(from: https://github.com/ampproject/amphtml/blob/master/extensions/amp-consent/integrating-consent.md#consentmetadata)

David Buck
  • 3,439
  • 29
  • 24
  • 31
Jan
  • 11
  • 1