openConsentForm
The openConsentForm() method opens the built-in Consent Manager (legacy) form. It doesn't work when you select Other consent tool, including when you use a custom consent form built with this JavaScript API.
Syntax
ppms.cm.api('openConsentForm', onFulfilled, onRejected);Parameters
onFulfilled: (popupId: string, consentTypes: string[], consents: string[]) => void
The fulfillment handler callback.
popupId: ID of the consent popup. Example:"ppms_cm_consent_popup_30a851b6-6bf4-45f9-9a53-583401bb5d60".consentTypes: Array of consent types. Example:["analytics", "conversion_tracking", "remarketing"].consents: Array of consent types currently approved by the visitor. Example:["analytics", "remarketing"].
onRejected: (error: object) => void
The rejection handler callback. If not specified, the error is logged in the console.
Examples
ppms.cm.api(
'openConsentForm',
function (popupId, consentTypes, consents) {
console.log(popupId, consentTypes, consents)
},
function (error) {
console.error(error)
}
)Updated 10 days ago
Did this page help you?