Meeting cookie consent requirements is critical for GDPR compliance and the success of your app. To prevent your app from being uninstalled by customers striving for compliance, ensure your app complies with the requirements and test it thoroughly.
Make sure to:
The method you use to access and monitor the consent policy depends on the type of extension. The following table provides the relevant methods for each extension type.
Extension | Get consent policy | Listen for changes |
---|---|---|
Custom elements | JavaScript SDK getCurrentConsentPolicy() | JavaScript SDK onConsentPolicyChanged |
Embedded scripts | JavaScript SDK getCurrentConsentPolicy() | JavaScript SDK onConsentPolicyChanged |
Wix Blocks apps | Velo getCurrentConsentPolicy() | Velo onConsentPolicyChanged |
iframe apps | wix.utils getCurrentConsentPolicy | wix.utils onConsentPolicyChanged |
Worker iframe apps | wix.worker Utils.getCurrentConsentPolicy | wix.worker Utils.onConsentPolicyChanged |
Note: For worker iframe apps, the consent policy is also passed as a query param in the iframe URL.
For custom elements and embedded scripts not using the JavaScript SDK, access consent policy information using the window
property:
Get the current consent policy:
Listen for consent policy changes:
These functions return the same properties as described in the SDK documentation.
Embedded scripts are automatically rendered or blocked based on the site visitor’s approval or denial of the cookie type, which corresponds to the script type selected during setup.
If your script falls into more than one category, always select the more restrictive category. For example, if the script is Functional, but also collects Analytics data, it should be marked as Analytics.
If your script has marketing or analytical functionalities but needs to be listed in one of the less restrictive categories in order to carry out its main functionalities, you should do one of the following:
Your script or functionality should load only if the user has granted consent.