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

Function getConsentStateStr

extensions/amp-analytics/0.1/variables.js:588–595  ·  view source on GitHub ↗

* Get the resolved consent state value to send with analytics request * @param {!Element} element * @return {!Promise<?string>}

(element)

Source from the content-addressed store, hash-verified

586 * @return {!Promise<?string>}
587 */
588function getConsentStateStr(element) {
589 return getConsentPolicyState(element).then((consent) => {
590 if (!consent) {
591 return null;
592 }
593 return EXTERNAL_CONSENT_POLICY_STATE_STRING[consent];
594 });
595}
596
597/**
598 * Get the associated value from the resolved consent metadata object

Callers 1

getMacrosMethod · 0.85

Calls 2

getConsentPolicyStateFunction · 0.90
thenMethod · 0.45

Tested by

no test coverage detected