Active Cookie Consent mode allows you to manage the data privacy settings of your users. In this mode, users are not served personalized experiences unless they actively provide consent. Only users who gave their consent - will receive personalized experiences. Users can opt-in or out at any time, and can change their previous state without limitations.
What Happens When Users Have Not Provided Consent?
- Reports and data are not collected at all.
- Dynamic Yield cookies are not set in their browser (unless you use a JS code to create a cookie).
- No variation stickiness (you can use the opt-out targeting condition to target variations to these users if you wish to avoid users getting multiple variations across session).
- Custom Code, Visual Edit and Push Notification campaigns are not served.
- Overlays and Notifications are served only if you approve that explicitly in the Active Consent Mode settings.
- Targeting by "Who" conditions (e.g. user properties, session behavior) do not target these users.
- Recommendations using personalized algorithms (e.g. affinity, deep learning) fallback to the closest non-personalized algorithm.
- Consent for triggered email campaigns is not managed using Active Cookie Consent. To handle consent for these campaigns, see Enabling Triggered Emails.
- Dynamic Links, Display Ads, and Landing Pages may fail to attribute conversions.
- Audiences: Users will not enter any audience report, but during a pageview will enter an audience (e.g. user who use a mobile device may enter an audience condition of "Mobile Users"), but since every pageview resets the user identity, they will not remain in audiences across session.
Note: This will also work in preview mode, as you preview the campaign and variation.
Enabling Active Cookie Consent Mode
Enabling Active Cookie Consent mode has the following steps:
- Implementing an API call on your <head> tag with the current consent preference of the user.
- Validating that implementation is done properly.
- Preview how existing campaigns are served to users who didn't provide consent, and make adjustments if needed.
- Contacting Dynamic Yield Support to turn on the Active Cookie Consent mode.
Step 1: Implement Active Cookie Consent APIs
In this mode, you need to use an API call to let Dynamic Yield know - on every page and for every user - if the user gave consent or not. This snippet should be implemented in the <head> tag of the page, after the page context.
Note: This is not going to impact your visitors until the Active Consent mode is turned on by Dynamic Yield Support. But it is a preliminary step for that.
If the user consents:
DY.userActiveConsent = { accepted: true }
If the user does not consent:
DY.userActiveConsent = { accepted: false}
Notice: While you should explicitly add the API for users that didn't give their consent as well. However, once the Active Consent Mode will be enabled (after Step 3) if this for some reason the API is not implemented - users will be considered as "False" anyway. Only users with explicit consent will be served with personalized experiences.
If the user changed their preferences and you want the change to happen immediately, use the following API call:
DYO.ActiveConsent.updateConsentAcceptedStatus(true)
Use "false" to notify that the user moved from consent to no consent:
DYO.ActiveConsent.updateConsentAcceptedStatus(false)
If you use a custom analytics integration, use an additional API in the code of the Custom Integration to prevent private user data from being sent to a third party.
Step 2: Validate Implementation of Active Cookie Consent APIs
It is crucial to validate that everything is implemented correctly. To do so:
- Check that the DY.UserActiveConsent is false
- Check that active consent is implemented in the head before the script (on three pages at least) - this is an example of a specific implementation, it can be different:
Example of how code should look like -
Check that the status changes with:
DYO.Consent.readStatus().then(function(status) {console.log('Active cookie consent status:', status) })
- Check that there are no console errors related to Active Consent implementation.
- Check that the customer used the API to change status, by opening the developer console, clicking on the Elements tab and pressing control+F, and pasting “updateConsentAcceptedStatus” (for example, you should see something similar).
Step 3: Contact Dynamic Yield Support
If you completed and verified the implementation, and your campaigns are ready - contact Dynamic Yield Support to turn on the Active Cookie Consent mode.
After enabled, it is recommended that you verify that data is indeed not collected for users who didn't provide consent. Look for the strings px.dynamicyield.com and px-eu.dynamicyield.com in their network calls. These strings should not exist if data is not being collected.
Step 4: Preview Existing Campaign
You might want to check how users that did not provide consent experience your site. Reminder, these users will not be served with experiences that have personalized targeting, as well as additional limitations. See more details above.
To preview how users who didn't provide consent experience your site:
- Go to Settings › General Settings › Active Cookie Consent and click Preview Site.
- Visit your site, and see which campaigns are served in what are the experiences that you're served with.
What's Next?
Since users who did not provide consent are served with limited Dynamic Yield experiences - you might want to edit some of your campaigns.
- If all the experiences in a campaign use a targeting condition from the "who" category, the campaign will not be served to users who didn't provide consent. You might want to create another experience for these users - do so without using these conditions.
- If you have a test with multiple variations - remember that users who didn't provide consent will not have variation stickiness. This means that they might see different variations on every pageview. If you want to avoid that, you can exclude them from the experience targeting by using the "Active Consent" targeting condition.
How Can I Target Users Who Have Not Given Consent with Unique Experiences?
Dynamic Yield provides a targeting condition designed to target users who have not given consent when Active Cookie Consent is enabled. For example, if you have a personalized experience on your homepage, you might want to create an alternative experience for the users who will not be served with the personalized experience.
To do this, create an experience that is targeted only to users who have not consented using the targeting condition Active Consent.