MCPcopy Create free account
hub / github.com/ampproject/amphtml / getConsentMetadata

Function getConsentMetadata

src/consent.js:65–77  ·  view source on GitHub ↗
(element, policyId = 'default')

Source from the content-addressed store, hash-verified

63 * @return {!Promise<?Object|undefined>}
64 */
65export function getConsentMetadata(element, policyId = 'default') {
66 // Return the stored consent metadata.
67 return Services.consentPolicyServiceForDocOrNull(element).then(
68 (consentPolicy) => {
69 if (!consentPolicy) {
70 return null;
71 }
72 return consentPolicy.getConsentMetadataInfo(
73 /** @type {string} */ (policyId)
74 );
75 }
76 );
77}
78
79/**
80 * Returns a set of consent values to forward to a 3rd party (like an iframe).

Callers 8

layoutCallbackMethod · 0.90
getConsentInfoMethod · 0.90
getConsentData_Method · 0.90
initiateAdRequestMethod · 0.90
getConsentMetadataValueFunction · 0.90
sendConsentData_Method · 0.90
bindToAmpConsent_Method · 0.90
getIframeContext_Method · 0.90

Calls 2

thenMethod · 0.45

Tested by

no test coverage detected