Salesforce

Cookie Consent Integration with Adobe Launch

« Go Back
Information
Cookie Consent Integration with Adobe Launch
UUID-25f01a3b-6379-1bf0-49b5-b4b847ff9d34
English
Checked
Content

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.

  1. Select the property where you want to insert the the Cookie Banner.

  2. Click the Rules tab. The Rules screen appears.

  3. Click the Create New Rule button.

  4. Name the rule Cookie Banner.

  5. Add a new event to the rule.

  6. Configure the event as shown.

    adobe_launch_rules.png

    Field

    Value

    Extension

    Core

    Event Type

    Library Loaded (Page Top)

    Name

    Core - Library Loaded (Page Top)

    Order

    50

  7. Click the Keep Changes button.

  8. Add a new action to the rule.

  9. Configure the action as shown.

    launch_action_configuration_banner.png

    Field

    Value

    Extension

    Core

    Action Type

    Custom Code

    Name

    Core - Custom Code

    Language

    HTML

  10. Click the Keep Changes button.

  11. Click the Open Editor button.

  12. 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>
    <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>
  13. Click Save.

    launch_rule_configuration_banner.png

    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

  1. Select the property where you want to insert the the Cookie Banner.

  2. Click the Rules tab. The Rules screen appears.

  3. Click the Create New Rule button.

  4. Name the rule Click Allow All Cookies.

  5. Leverage steps 5–13 in the above section to configure your rule, repeating 8–10 to configure two separate actions.

    Event Configuration

    Field

    Value

    Extension

    Core

    Event Type

    Click

    CSS Selector

    #onetrust-accept-btn-handler

    Action 1 Configuration

    Field

    Value

    Extension

    Adobe Analytics

    Action Type

    Set Variables

    Events

    Select Click Allow All Cookies

    Event Value

    Allow All Cookies

    Action 2 Configuration

    Field

    Value

    Extension

    Adobe Analytics

    Action Type

    Send Beacon

    Tracking

    s.tl()

    Link Type

    Custom Link - Allow All Cookies

CSS Selectors for OneTrust CMP Buttons

Button

Selector

Banner

Allow All

#onetrust-accept-btn-handler

Reject All

#onetrust-reject-all-handler

Settings

#onetrust-pc-btn-handler

Close Button

#onetrust-close-btn-container > button

Preference Center

Allow All

#accept-recommended-btn-handler

Confirm Choices/Save Settings

#onetrust-pc-sdk > div.ot-pc-footer > div.ot-btn-container > button

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

  1. Select the property where you want to activate cookie blocking.

  2. Go to the Data Elements tab. The Data Element list appears.

  3. Click the Add Data Element or Create New Data Element button. The Edit Data Element screen appears.

  4. Configure fields as follows.

    OTactivegroups.png

    Field

    Value

    Name

    Onetrust Active Groups

    Extension

    Core

    Data Element Type

    JavaScript Variable

    Storage Duration

    Visitor

    Path to variable

    OptanonActiveGroups

  5. Click Save.

  6. Go to the Rules tab. The Rule list appears.

    Note

    You must edit all rules that have cookie-associated actions.

  7. Select an existing rule.

  8. 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.

  9. Fill out the fields as follows.

    AdLaunchEvent2.png

    Field

    Value

    Extension

    Core

    Event Type

    Custom Event

    Name

    Core - Custom Event

    Order

    50

    Custom Event Type

    OneTrustGroupsUpdated

    Element

    any element

  10. 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.

  11. Press the + button under Conditions. The Condition Configuration screen appears.

  12. Fill out the fields as follows.

    condition_config.png

    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

  13. Click Keep Changes.

  14. Repeat this for the remaining rules.

To block cookies using the OptanonConsent cookie

  1. Select the property where you want to activate cookie blocking.

  2. Go to the Data Elements tab. The Edit Data Element modal appears.

  3. Click the Add Data Element button. The Create New Data Element screen appears.

  4. Fill out the fields as follows.

    LaunchCookieConfig.png

    Field

    Value

    Name

    Optanon Consent

    Extension

    Core

    Data Element Type

    Cookie

    Storage Duration

    None

    Cookie Name

    OptanonConsent

  5. Click Save.

  6. Go to the Rules tab. The Rule list appears.

    Note

    You must edit all rules that have Cookie-associated actions.

  7. Click on an existing rule.

  8. 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.

  9. Configure the fields as follows.

    ot_groups_updated.png

    Field

    Value

    Extension

    Core

    Event Type

    Window Loaded

    Name

    Core - Window Loaded

    Order

    50

  10. 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.

  11. Press the + button under Conditions. The Condition Configuration screen appears.

  12. Configure the fields as follows:

    optanon_conditions.png

    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

  13. Click Keep Changes.

To enable blocking with an extension

  1. Select the property where you want to activate cookie blocking.

  2. Go to the Extensions tab. The Extensions modal appears.

  3. Search for the OneTrust extension.

  4. Click the Save button to install the extension.

  5. Use the extension to set up conditions for rules.

    ExConditions.png

    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.)

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.

 

Powered by