In this article, you’ll learn the following: |
Overview
Tracking visitors is crucial for enhancing their experience on your website. However, it's purely dependent on visitors’ consent. VWO honors this effort by providing the facility to align with your cookie consent settings.
By nature,
-
VWO tracks conversions and visitor behavior when the visitor understands the need for tracking and provides consent.
- VWO does not track conversions and visitor behavior when the visitor declines to consent.
However, not all visitors respond to the tracking request. Sometimes, they ignore it and continue. In such cases, based on your business requirements, you can configure the VWO SmartCode to enable or disable tracking, allowing changes to be applied without tracking if needed.
For example, if your tracking request banner features a notification that proceeding further into the website would be deemed an acceptance, then you can configure VWO SmartCode's behaviour to align with your tracking criteria when consent is pending.
NOTE: A visitor's explicit consent status is considered ‘pending’ from the moment they land on the page until they provide a response.
Prerequisites
The Cookie Consent Manager added to your website should be updated to whitelist the first-party cookies mentioned here. Alternatively, if your cookie consent manager supports regular expressions (regex), add the following two regex to whitelist the cookies:
- _vwo_*
- *_vis_*
Where to Access the Feature?
To configure the tracking behaviour of VWO when the tracking request is kept pending, perform the following steps:
- On the main menu, go to Configurations > Websites and Apps > select your website.
- Under the Code tab, you’ll find your VWO SmartCode in HTML mode.
- Under the SmartCode section, check the Enable Cookie Consent checkbox.
- The Cookie Consent Manager section appears.
The dropdown lists supported cookie consent managers. Based on your selection, the corresponding code to control VWO behavior according to cookie consent will be auto-filled in the Configure initialization based on cookie consent editor field below. From the dropdown, select the cookie consent manager that your organization uses.Note:- VWO attempts to detect the cookie consent manager on your website when it is first added. If detected, the corresponding option is auto-selected in the dropdown the first time.
- The Cookie Consent Manager option is available under both Advanced Cookie Consent Handling and Basic Cookie Consent Handling sub-feature offerings. However, the functionality differs:
-
Advanced Cookie Consent Handling:
All configurations can be managed directly through the VWO dashboard. No additional code needs to be added to your website. -
Basic Cookie Consent Handling:
This option is disabled, and Other is selected by default in the dropdown. You must manually implement the required code on your website to handle VWO behavior based on the visitor’s consent state.
Refer to VWO Pricing & Plans for more details.
-
Advanced Cookie Consent Handling:
- If your cookie consent manager is supported, you can configure the consent manager directly from the VWO dashboard by selecting it from the dropdown. In this case, it is recommended that you update the value of the category field (or a similar classification field) of the cookie consent manager to ensure VWO functions as expected when a visitor provides consent. For example, in the screenshot below, the category is set to ‘marketing’. This ensures, when a visitor provides or declines consent for marketing cookies to be tracked, VWO functions as expected.
Other customizations are available but optional. No changes are required on the website to handle VWO behavior based on cookie consent.
- If your cookie consent manager is not supported, select Custom from the dropdown. In this case, you must manually add the required code in the Configure initialization based on cookie consent field below it. This handling is applied within the VWO dashboard, you do not need to add it separately to your website.
- If your use case cannot be achieved using the available default options or custom handling, select Other from the Cookie Consent Manager dropdown.
- When Other is selected from the Cookie Consent Manager dropdown, you must manually add the required code to your website to manage VWO functionality based on visitors’ cookie consent. For more information, see How to Enable VWO to Detect the Cookie Consent Status for the 'Other' Option?
The Configure initialization based on cookie consent field is non-editable when Other is selected from the cookie consent manager dropdown. - By default, VWO’s behaviour and data collection based on cookie consent status is applied to VWO Insights. To apply it to Testing, Personalize, and Rollout, turn on the Enable for VWO Testing, Personalize, and Rollout toggle.Note:
- This option is enabled by default in accounts where the Enable Cookie Consent setting was turned on before the rollout of the Advanced Cookie Consent Handling sub-feature.
- VWO Insights starts collecting data only after the visitor accepts the cookie consent.
- Under Manage VWO behaviour when cookie consent is pending, select an appropriate option from the dropdown:
- Completely Block VWO
- Partially Block VWO
- Do not block VWO
See the table below for more details about each option.
Action | VWO’s Tracking Behaviour |
Completely Block VWO |
While consent is pending: SmartCode won’t function. NOTE: If cookie consent detection times out and cookie consent for VWO is provided afterwards, testing campaigns will work from the next visit to ensure a good UX, while insights campaign tracking will work from the same visit. |
When the visitor provides consent: SmartCode will start working | |
When the visitor declines the tracking request: SmartCode won’t function, and thereby,
|
|
Partially Block VWO NOTE: This option will not be available for accounts with Insights-only campaigns. |
While consent is pending: SmartCode functions partially as follows:
|
When the visitor provides consent:
|
|
When the visitor declines the tracking request:
|
|
Do not Block VWO | While consent is pending: SmartCode works as usual |
When the visitor provides consent: SmartCode continues working | |
When the visitor declines the tracking request:
|
Things to Remember
- If a visitor initially declines the tracking request but accepts it later, VWO will only start functioning from their next visit. Any actions performed during the period when tracking was declined will not be tracked, and no campaigns will run during that time.
- Campaign live preview respects cookie consent settings, showing messages accordingly:
- "Cookie consent rejected" when consent is rejected.
- "Waiting for cookie consent" when completely blocked and consent is pending.
- "Cookie consent rejected" when consent is rejected.
- Your campaign’s direct preview link will ignore the cookie consent configurations.
- When a VWO campaign spans multiple domains/subdomains, its functionality based on cookie consent depends on the specific configurations set for each. Therefore, if you need to implement a cookie consent popup in a domain/subdomain where you’re running VWO campaigns, you should register each domain/subdomain individually in VWO.
- Ensure the prerequisite is met, with priority on _vwo_consent. This cookie records visitor consent for VWO, setting 1 for consent and 0 for denial, determining if VWO can operate. When "Partially Block VWO" is selected and consent is pending, essential tracking data is stored temporarily to ensure tracking accuracy upon consent approval.
How to Enable VWO to Detect the Cookie Consent Status for the 'Other' Option?
To ensure VWO respects a visitor’s cookie consent preferences, you must include the appropriate code snippet in your website’s source code at the relevant points where consent-based functionality is configured. You can implement this as follows:
Use a single numeric value to represent the visitor’s overall consent status. This value applies to both Insights and Testing.
While applying the code, replace <number-value> with the corresponding value based on the visitor's consent status:
- 1 for Accepted
- 2 for Pending
- 3 for Rejected
If you want to enable VWO to detect an acceptance, modify the code as follows:
Similarly, if you want to enable VWO to detect a rejection, modify the code as follows:
Options for ‘Completely Block VWO’
By default, the Completely Block VWO option is applied to your VWO SmartCode, which will also entail the following options:
Cookie Consent Detection Timeout
When a visitor arrives on your webpage and hasn't responded to the cookie consent prompt, they will be served the original web page content. You can configure a timeout duration for VWO to apply the appropriate variation based on the visitor’s response.
By default, the value is configured to 2000 ms. If the visitor does not consent within this set threshold, VWO will not apply any campaign changes, ensuring a consistent and uninterrupted user experience (UX).
Enable Blurred Background
If your campaign involves visual changes, you can opt to blur the webpage content until they respond to the tracking request. To implement this, select this option and specify the CSS selector for the cookie consent popup. This ensures that only the content of the webpage is blurred, keeping the consent popup visible.
This feature ensures that VWO can apply the appropriate content variation after the visitor’s consent for tracking while preventing any flash of original content.
The blurred background will be removed immediately upon detecting the visitor's cookie consent response, whether accepted or rejected or when the cookie consent detection timeout period expires.
Need more help?
For further assistance or more information, contact VWO Support.