apo
apo

Reputation: 21

Is there a way to retrieve GDPR consent string from <amp-consent> within an <amp-iframe>?

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

Answers (1)

Jan
Jan

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

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

Upvotes: 1

Related Questions