Cookie consent requirements are a critical part of GDPR complaince and is critical to your app's success. To prevent your app from being uninstalled by customers striving for compliance, ensure your app's compatibility with the requirements and test thoroughly.
Make sure to:
The following sections describe how to complete these two steps based on extension type.
Access the visitors’ consent policies with these wix.utils functions:
Access the visitors’ consent policies with these wix.worker functions:
The consent policy will also be passed as a query param in the iframe URL.
Embedded script apps will be automatically rendered or blocked based on the site visitor’s approval or denial of the above options, which correspond to the script type selected during setup.
If your script falls into more than one category (for example, it's Functional, but also collects Analytics about users) you should select the more restrictive category (so in our example, the script 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:
In order to take the users’ selected policy into account, you should use a client side API and event:
This means that the rest of your script (or functionality) should be loaded only if the user has accepted.
window.consentPolicyManager.getCurrentConsentPolicy()
Property | Type | Description |
---|---|---|
defaultPolicy | boolean | False only if the User has selected a policy |
policy | ConsentPolicy (object) | The policy that is currently active |
createdDate | Date / undefined | If this is NOT a defaultPolicy this is when the policy was set |
ConsentPolicy includes:
Property | Type | Description |
---|---|---|
essential | boolean | Always true - means we allow our necessary cookies / BI |
analytics | boolean | If we are allowed to send / use analytics cookies / BI |
functional | boolean | If we are allowed to send / use functional cookies / BI |
advertising | boolean | If we are allowed to send / use advertising cookies / BI |
dataToThirdParty | boolean | Relates to CCPA law - if we are allowed to transfer data to 3rd parties or embed their scripts |
Dispatched on the document object. Triggers when a consent policy change was completed successfully.
Sample listener code:
The detail object under the event contains a ConsentPolicy object.
Access the visitors’ consent policies with these Velo functions: