Go Headless

Changelog

SDK
Articles
Get Started
Work with the SDK
Set up a Client
Use the Wix MCP

Core Modules
About Core Modules
sdk
essentials
web-methods

Host Modules
About Host Modules
dashboard
editor
site
Introduction
Analytics
Events
Consent Policy Manager
Introduction
getCurrentConsentPolicy()
onConsentPolicyChanged()
resetConsentPolicy()
setConsentPolicy()

Business Solutions
About Business Solutions
ai-site-chat
blog
bookings
cache
crm
data
ecom
events
restaurants
stores
realtime

Frontend Modules
About Frontend Modules
bookings
crm
ecom
events
location
members
mobile
navigate-mobile
pay
pricing-plans
seo
site
storage
stores
window
site-realtime

onConsentPolicyChanged( )


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.

Method Declaration
Copy
Method Parameters
handlerConsentPolicyChangedHandlerRequired

The function to run when the consent policy changes

Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?