Cookie Consent Integration with Adobe Launch
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
Cookie Consent 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.
Field
Value
Extension
Core
Event Type
Library Loaded (Page Top)
Name
Core - Library Loaded (Page Top)
Order
50
- Click the Keep Changes button.
- Add a new action to the rule.
- Configure the action as shown.
Field
Value
Extension
Core
Action Type
Custom Code
Name
Core - Custom Code
Language
HTML
- Click the Keep Changes button.
- Click the Open Editor button.
- Add your published Cookie Banner script and the following code to the script:
JAVASCRIPT
<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.
Table 1. Event Configuration Field
Value
Extension
Core
Event Type
Click
CSS Selector
#onetrust-accept-btn-handlerTable 2. Action 1 Configuration Field
Value
Extension
Adobe Analytics
Action Type
Set Variables
Events
Select Click Allow All Cookies
Event Value
Allow All Cookies
Table 3. Action 2 Configuration Field
Value
Extension
Adobe Analytics
Action Type
Send Beacon
Tracking
s.tl()
Link Type
Custom Link - Allow All Cookies
Table 4. CSS Selectors for OneTrust CMP Buttons Button
Selector
Banner
Allow All
#onetrust-accept-btn-handlerReject All
#onetrust-reject-all-handlerSettings
#onetrust-pc-btn-handlerClose Button
#onetrust-close-btn-container > buttonPreference Center
Allow All
#accept-recommended-btn-handlerConfirm Choices/Save Settings
#onetrust-pc-sdk > div.ot-pc-footer > div.ot-btn-container > button
To configure cookie blocking rules
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.
Field
Value
Name
Onetrust Active Groups
Extension
Core
Data Element Type
JavaScript Variable
Storage Duration
Visitor
Path to variable
OptanonActiveGroups
- 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
OneTrustGroupsUpdatedevent gets pushed. You must create an event listener to that event. - Fill out the fields as follows.
Field
Value
Extension
Core
Event Type
Custom Event
Name
Core - Custom Event
Order
50
Custom Event Type
OneTrustGroupsUpdated
Element
any element
- Click Keep Changes.
Note:
Page load events on rules should be replaced by the
OneTrustGroupsUpdatedevent. 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
OneTrustGroupsUpdatedevent. - Press the + button under Conditions. The Condition Configuration screen appears.
- Fill out the fields as follows.
Field
Value
Logic Type
Regular
Extension
Core
Condition Type
Variable
Name
Core - Variable
JS variable name
OnetrustActiveGroups
has the value
,C0002, (This will change depending on the cookie category)
Regex
Active
- 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.
Field
Value
Name
Optanon Consent
Extension
Core
Data Element Type
Cookie
Storage Duration
None
Cookie Name
OptanonConsent
- 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
OneTrustGroupsUpdatedevent gets pushed. You must create an event listener to that event. - Configure the fields as follows.
Field
Value
Extension
Core
Event Type
Window Loaded
Name
Core - Window Loaded
Order
50
- Click Keep Changes.
Note:
Page load events on rules should be replaced by the
OneTrustGroupsUpdatedevent. 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
OneTrustGroupsUpdatedevent. - Press the + button under Conditions. The Condition Configuration screen appears.
- Configure the fields as follows:
Field
Value
Logic Type
Regular
Extension
Core
Condition Type
Cookie
Name
Core - Cookie
Cookie named
OptanonConsent
has the value
C0002:1 (This will change depending on the group.)
Regex
Active
- 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.
Field
Value
Logic Type
Regular
ExtenstionEvent Type
OneTrust Consent Management for Cookies
Condition Type
Performance Cookies Active
Name
OneTrust Consent Management for Cookies - Performance Cookies Active
OneTrustActiveGroups Variable Contains:
,C0002, (This will change depending on the group.)
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.