Search...
resetConsentPolicy( )
Removes the current policy from the visitor's browser and resets the visitor's consent policy to the default policy for the site.
Description
The resetConsentPolicy()
function returns a Promise that resolves when the policy is reset.
Syntax
function resetConsentPolicy(): Promise<void>
resetConsentPolicy Parameters
This function does not take any parameters.
Returns
Fulfilled - When the reset is complete. Rejected - Error message.
Return Type:
Promise<void>
Was this helpful?
Reset a visitor's consent policy
Copy Code
1import { consentPolicy } from 'wix-window-frontend';23// ...45consentPolicy.resetConsentPolicy()6 .then((policy) => {7 console.log("The policy is now set to the default site policy.");8 return policy;9 })10 .catch((error) => {11 console.error(error);12 });