If you use Adobe Launch to insert scripts or code that sets your cookies, you can configure the tool so that scripts are controlled by the consent preferences set by site visitors.
This makes deployment easier than using the standard helper methods described in Client-Side Cookie Management. However, there are some differences in behavior.
How it Works
uses an Adobe Launch Data Element to pass information to Launch using a dedicated JavaScript variable. OneTrust adds a key named OnetrustActiveGroups
with a value of a comma delimited string of the current active group IDs as selected by the visitor (or the default configuration).
This key is repopulated on every page load once the script is executed. For example, the data contained in the value might be ,C0002,C0003,C0004,
.
To deploy the Cookie Banner script
If you use Adobe Launch to manage the scripts and tags on your website, you can also inject your banner script into the site.
-
Select the property where you want to insert the the Cookie Banner.
-
Click the Rules tab. The Rules screen appears.
-
Click the Create New Rule button.
-
Name the rule Cookie Banner.
-
Add a new event to the rule.
-
Configure the event as shown.
-
Click the Keep Changes button.
-
Add a new action to the rule.
-
Configure the action as shown.
-
Click the Keep Changes button.
-
Click the Open Editor button.
-
Add your published Cookie Banner script and the following code to the script:
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="INSERT DATA DOMAIN ID FOR DOMAIN HERE" ></script><script type="text/javascript">
function OptanonWrapper() { }
</script>
-
Click Save.
Important
If your organization already has script blocking rules in place that reflect your cookie list, you can stop here.
If your organization does not yet have script blocking rules in place, continue to the remaining steps.
To collect click events/actions
-
Select the property where you want to insert the the Cookie Banner.
-
Click the Rules tab. The Rules screen appears.
-
Click the Create New Rule button.
-
Name the rule Click Allow All Cookies.
-
Leverage steps 5–13 in the above section to configure your rule, repeating 8–10 to configure two separate actions.
Event Configuration
Action 1 Configuration
Action 2 Configuration
CSS Selectors for OneTrust CMP Buttons
To configure cookie blocking rules
Note
This document provides multiple ways to set up rules. You can pick the method that best suits your needs.
To block cookies using OnetrustActiveGroups
-
Select the property where you want to activate cookie blocking.
-
Go to the Data Elements tab. The Data Element list appears.
-
Click the Add Data Element or Create New Data Element button. The Edit Data Element screen appears.
-
Configure fields as follows.
-
Click Save.
-
Go to the Rules tab. The Rule list appears.
Note
You must edit all rules that have cookie-associated actions.
-
Select an existing rule.
-
Press the + button under Event. The Event Configuration screen appears.
Note
When a user updates their consent, the OneTrustGroupsUpdated
event gets pushed. You must create an event listener to that event.
-
Fill out the fields as follows.
-
Click Keep Changes.
Note
Page load events on rules should be replaced by the OneTrustGroupsUpdated
event. That will ensure rules listen to the change of categories instead of firing before categories have been set.
Events happening later in the user journey, such as click events, form submissions, etc., may not need to be replaced with the OneTrustGroupsUpdated
event.
-
Press the + button under Conditions. The Condition Configuration screen appears.
-
Fill out the fields as follows.
-
Click Keep Changes.
-
Repeat this for the remaining rules.
To block cookies using the OptanonConsent cookie
-
Select the property where you want to activate cookie blocking.
-
Go to the Data Elements tab. The Edit Data Element modal appears.
-
Click the Add Data Element button. The Create New Data Element screen appears.
-
Fill out the fields as follows.
-
Click Save.
-
Go to the Rules tab. The Rule list appears.
Note
You must edit all rules that have Cookie-associated actions.
-
Click on an existing rule.
-
Press the + button under Event. The Event Configuration screen appears.
Note
When a user updates their consent, the OneTrustGroupsUpdated
event gets pushed. You must create an event listener to that event.
-
Configure the fields as follows.
-
Click Keep Changes.
Note
Page load events on rules should be replaced by the OneTrustGroupsUpdated
event. That will ensure rules listen to the change of categories instead of firing before categories have been set.
Events happening later in the user journey, such as click events, form submissions, etc., may not need to be replaced with the OneTrustGroupsUpdated
event.
-
Press the + button under Conditions. The Condition Configuration screen appears.
-
Configure the fields as follows:
-
Click Keep Changes.
To enable blocking with an extension
-
Select the property where you want to activate cookie blocking.
-
Go to the Extensions tab. The Extensions modal appears.
-
Search for the OneTrust extension.
-
Click the Save button to install the extension.
-
Use the extension to set up conditions for rules.
Note
The extension has been set up to include category IDs in the form of : ,X, where X is a number between 2-4. That will need to be updated to ,C000X, with X being a number 2-4 which corresponds to the Out of the Box Category ID or any category ID that you are using.
The Social Media Cookie Category is not part of the Extension. If you seek to block Social-Media cookies, please follow one of the previous two methods.