Sets the current visitor's consent policy regarding allowed cookies and data transfer to 3rd parties, such as for GDPR or CCPA purposes.
The setConsentPolicy()
function returns a Promise that resolves to the
consent policy details of the visitor.
You can use the onConsentPolicyChanged()
event to listen for
changes made when a visitor changes their consent policy with setConsentPolicy()
. Handle
the policy change accordingly in the event handler's ConsentPolicyChangedHandler callback function.
Changes to the consent policy take affect after the page is refreshed.
An object representing the cookies of the visitor's consent policy.