Overview
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
sdk-react (deprecated)
essentials
web-methods
realtime

Host Modules
About Host Modules
workspace
dashboard
dashboard-react (deprecated)
editor
site
Introduction
Analytics
Events
Consent Policy Manager
Introduction
getCurrentConsentPolicy()
onConsentPolicyChanged()
resetConsentPolicy()
setConsentPolicy()
Authentication
MultilingualManager

Data Items SDK
data
ai-site-chat
events

Site SDK
Introduction
Pages and Navigation
Site Settings
Rendering and Performance
Accessibility and Devices

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?