This method is deprecated.
Deprecated. This method will continue to work, but a newer version is available. Use the onConsentPolicyChanged() method instead.
If this method is already in your code, it will continue to work.
To stay compatible with future changes, migrate to onConsentPolicyChanged().
To migrate to the new method:
Add the new import statement:
If you plan to migrate all methods that use onConsentPolicyChanged(),
remove the original import { consentPolicy } from "wix-window-frontend"; statement.
Look for any code that uses consentPolicy.onConsentPolicyChanged(),
and replace it with the new import.
Update your code to work with the new onConsentPolicyChanged()
call and response properties.
Test your changes to make sure your code behaves as expected.
Note: Check the new method documentation for any differences in parameters, return values, or behavior compared to the deprecated onConsentPolicyChanged() method.
Triggered when a site visitor's consent policy was changed using setConsentPolicy() or reset using resetConsentPolicy().
Use the onConsentPolicyChanged() method for code you want to run after
the site visitor's current consent policy was changed using
setConsentPolicy() or reset using
resetConsentPolicy().
Usually, you want to call the onConsentPolicyChanged() method in the masterpage.js file so that the onConsentPolicyChanged() event runs no matter which
page on a site is used to change the policy.
handler(event: ConsentPolicyChangedEvent): void The name of the method to run when the consent policy changes.