Sets the function that runs
when a visitor's consent policy was changed using
setConsentPolicy()
or reset using
resetConsentPolicy()
.
Use the onConsentPolicyChanged()
function for code you want to run after
the visitor's current consent policy was changed using
setConsentPolicy()
or reset using
resetConsentPolicy()
.
Usually, you want to call the onConsentPolicyChanged()
function in the masterpage.js file in the
code editor so that the onConsentPolicyChanged()
event handler runs no matter which
page on your site is used to change the policy.
handler(event: ConsentPolicyChangedEvent): void
The name of the function or
the function expression to run when the consent policy is changed.