CCM Advanced - Adobe Experience Platform Integration

Version: 1.8

Last Updated: July 30, 2026

 

Overview

The Cookie Consent Manager can integrate with Adobe Experience Platform's data collection technologies (formerly Launch by Adobe). This next-generation tag management capability within the Adobe Experience Cloud Platform enables clients to:

Deploy client-side web products using integrations called extensions.
Consistently capture, define, manage, and share data between marketing and advertising products from both Adobe and other vendors.

The extensibility and open architecture of Adobe Experience Platform's data collection technologies allow TrustArc and Adobe customers to deploy and manage Cookie Consent Manager via an extension, based on their specific needs.

Connecting Your Website to Adobe Experience Platform

Before any TrustArc settings can take effect on your site, a small piece of code needs to be added to your website. This code acts as the connection point between your site and Adobe Experience Platform, allowing the Cookie Consent Manager and related configurations to load and run on your pages.

To add it, place the following script tag in the <head> section of every page on your site, as close to the top as possible:

<script src="//www.yourdomain.com/launch-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.min.js" async></script>

(Your actual script URL will be provided separately by Adobe and is unique to your site.)

Adding the Cookie Consent Manager Extension

An extension is a packaged set of code that extends the AEP interface and the library functionality. AEP is the platform and extensions are like apps that run on the platform.

📋 Note: These instructions describe deploying the TrustArc Cookie Consent Manager (CCM) Script tag using an AEP extension and configuring the extension using a rule. If a more customized approach is needed such as deploying the CCM script tag directly in the page template, this can be done, but you will then not need to follow these steps as only one script tag is necessary.

To add the Cookie Consent Manager extension, follow the steps below.

1
Log in to the Adobe Experience Platform dashboard.
2
Select a property from the list. A property is a container that you fill with extensions, rules, data elements, and libraries as you deploy tags to your site. A property can be any grouping of one or more domains and subdomains. If a property is not created, you can create one by clicking New Property.
3
From the property's overview page, select the Extensions (1) tab.
Extensions tab in AEP property overview
4
Select Catalog (2) and type Cookie Consent Manager (3) in the Search field.
5
The search results display the Cookie Consent Manager widget. Click Install (4).
6
In the Install Extension window, click Save. Once saved, the Cookie Consent Manager is listed in the Extensions tab.
Cookie Consent Manager listed in Extensions tab
7
Install the Core extension, if not already installed.
Core extension in catalog
 
Core extension installed confirmation
Applying Rules to the TrustArc Cookie Consent Manager

Rules are used to set up the conditions and parameters for your extensions. When the criteria outlined in your rules are met, the rule triggers the CCM extension. The following rules must be set up in Adobe Experience Platform for your Cookie Consent Manager.

IMPORTANT: The TrustArc tag should be loaded at an early event to ensure that the notice_behavior cookie can drop before the influenced trackers attempt to fire. This cookie is used to determine firing rules based on whether the end-user is from a location configured as zero tracker load or not. To add the TrustArc tag and apply the rules, follow the steps below.
1
From the list of properties, select a Property where you want the rule to be applied.
2
From the Rules tab, click Add Rule or Create New Rule if this is your first time creating a rule.
Add Rule button in Rules tab
3
Enter a Name (2) for the rule, for example, TrustArc CCM.
4
Click the Add (3) icon under Events.
Add icon under Events
5
Enter the following values in each of the given fields:
Event configuration fields
Extension: Core
Event type: Library Loaded (Page Top)
This ensures that the TrustArc tag fires first before anything else.
Name: Provide a new event Name or leave it as the default.
Order: Set a new Order value or leave it as the default.
📋 Note: The default order for all rule components is 50. If two rules have the same event type, the one with the lowest number runs first.
6
Click Keep Changes. This sets the event you want the rule to look for before firing.
7
Click the Add icon under Actions.
Add icon under Actions
8
Enter the following values in each of the given fields:
Action configuration fields
Extension: Cookie Consent Manager
Action Type: Managed Service Consent Script
Name: Provide a new Name for this action or leave it as the default.
Domain: Enter the Domain in the field provided. This is a required identifier provided by your TrustArc Technical Account Manager.
Container: The Container ID should match the element used on the page.
📋 Note: It is recommended to use the default ID teconsent.
9
Leave the Language, Country, Privacy Policy Link, and Cookie Policy Link fields as is.
10
It is recommended to select from the following checkboxes by default:
Text
Use Root Scope
Zero Cookie Load
Consent Banner
📋 Note: Due to a feature change, we now always use CDN. We suggest that you do not enable this option because it is now a legacy preference.
11
Click Keep Changes. The actions are performed once an event is triggered and all conditions and exceptions are evaluated.
12
Click Save to create the rule.
Adding a Page Reload Script

The Page Reload Script ensures that when a user updates their consent preferences, the page automatically reloads. This refresh is essential for immediately removing any cookies or trackers that the user has declined, ensuring that their privacy choices are fully applied and respected. To add the page load script, follow these steps:

1
From the list of properties, select a Property where you want the rule to be applied.
2
From the Rules tab, click Add Rule.
3
Enter a Name (1) for the load script, such as Modal Window Page Reload.
4
Click the Add (2) icon under Events.
Add icon under Events for page reload rule
5
Enter the following values on each of the given fields:
Event configuration for page reload rule
Extension: Core
Event Type: DOM Ready
Name: Provide a new event Name or leave it as the default.
Order: Set a new Order value or leave it as the default.
📋 Note: The default order for all rule components is 50. If two rules have the same event type, the one with the lowest number runs first.
6
Click Keep Changes.
7
Click the Add icon under Actions.
Add icon under Actions for page reload rule
8
Enter the following values on each of the given fields:
Action configuration for page reload
Extension: Core
Action Type: Custom Code
Name: Enter a new name for this action or leave it as the default.
Language: Select HTML
9
Click </> Open Editor and enter the following code:
<script>
window.addEventListener("message", function(event) {
    var eventDataJson = null;
    // We only care about TrustArc Events at this point. And TrustArc's event is encoded in JSON
    try {
        eventDataJson = JSON.parse(event.data);
    } catch (e) {
        // Some other event that is not JSON.
        // TrustArc encodes the data as JSON
        // console.log(event.data);
    }
    // Safeguard to make sure we are only getting events from TrustArc
    if (eventDataJson && eventDataJson.source === "preference_manager") {
        // Means that the user has submited their preferences
        if (eventDataJson.message === "submit_preferences") {
            setTimeout(function() {
                window.location.reload();
            }, 1000);
        }
    }
}, false);
</script>
📋 Note: You can also copy the code from: https://gist.github.com/trustarctam/0da8eef5ffa95c49de677e16e0f6ec68
10
Click Keep Changes. The actions are performed once an event is triggered and all conditions and exceptions are evaluated.
11
Click Save to save the Page Reload script.
TrustArc Events and Conditions

This section explains how to set up your Data Elements, Events, and Conditions to properly manage rules in Adobe Experience Manager.

Data Elements

The following Data Elements are used to determine whether a rule should be injected into the page. You will need to create each Data Element within your AEM Property.

trackerConsent

This Data Element is used to identify if the user's consent is present or to identify the level of consent the user provided. This Data Element uses the value of the cmapi_cookie_privacy cookie, which has the following values:

1 – refers to preference selections for Required (always present as the user cannot opt out of Required)
2 – refers to preference selections for Functional
3 – refers to preference selections for Advertising
4+ – refers to preference selections for custom buckets

To configure this Data Element, follow the steps below:

1
In the Data Elements tab, click Add Data Element.
2
Enter the following information in each given fields:
trackerConsent data element fields
Name: trackerConsent
Extension: Core
Data Element Type: Cookie
Cookie Name: cmapi_cookie_privacy
3
Click Save.
trackerBehavior

This Data Element uses the value of the notice_behavior cookie to identify the behavior (Expressed or Implied) and which consent manager is being used (EU or US) in the Consent Manager configuration, based on the country or state from which the user is connecting. Below are the possible values for this cookie:

expressed,eu
expressed,us
implied,eu
implied,us
none

To configure this Data Element, you may follow the steps below:

1
In the Data Elements tab, click Add Data Element.
2
Enter the following information in each given fields:
trackerBehavior data element fields
Name: trackerBehavior
Extension: Core
Data Element Type: Cookie
Cookie Name: notice_behavior
3
Click Save.
consentModel

This Data Element is using the value of one of our API keys, which is the Consent Model. This key has the value 'opt-in' or 'opt-out,' which you can use to identify whether the experience should be an opt-in or opt-out experience based on the Consent Manager configuration per country or state. You can use this Data Element instead of the trackerBehavior.

📋 Note: Contact your Technical Account Manager to assist you in reviewing these settings.

To configure this Data Element, you may follow the steps below:

1
In the Data Elements tab, click Add Data Element.
2
Enter the following information in each given fields:
consentModel data element fields
Name: consentModel
Extension: Core
Data Element Type: JavaScript Variable
JavaScript variable name: window.truste.eu.bindMap.consentModel
3
Click Save.
isFunctionalAllowed

In this Data Element, you add a custom code that will be used in a rule condition to check whether Functional Trackers are allowed according to the user's consent. The function that will return the boolean values 'true' or 'false.'

To configure this Data Element, you may follow the steps below:

1
In the Data Elements tab, click Add Data Element.
2
Enter the following information in each given fields:
isFunctionalAllowed data element fields
Name: isFunctionalAllowed
Extension: Core
Data Element Type: Custom Code
3
Click Open Editor.
4
Enter the code below based on the setup that you want to follow:

Option 1: Using trackerBehavior and trackerConsent

IMPORTANT: The code snippet needs to be adjusted according to your region-based Consent Manager Experience. The snippet below provides several options, and we strongly recommend testing to ensure that the website visitor's preferences are being honored correctly. This includes verifying that tags and cookies are properly blocked or removed when consent is not given. Please feel free to modify the code as needed to meet your specific requirements.
var pref = _satellite.getVar('trackerConsent');
var experience = _satellite.getVar('trackerBehavior');
var isfunctionalallowed = false;

/*This is the code you can use if you are using notice_behavior for Zero-Tracker Load (expressed behavior)*/
isfunctionalallowed = (pref == undefined && experience.match(/\b[^;]*\bimplied\b[^;]*/)) || (pref != undefined && pref.match(/\b2\b/))

/*This is the code you can use if you are using notice_behavior for Zero-Tracker Load (using EU Manager only)*/
//isfunctionalallowed =  (pref != undefined && pref.match(/\b2\b/));

/*This is the code you can use if the CM configuration is Implied or Non-ZTL (All Countries)*/
//isfunctionalallowed = (pref == undefined && experience.match(/\b[^;]*\bus\b/)) || ((pref == undefined) || (pref != undefined && pref.match(/\b2\b/)));

/*This is the code you can use if you are using notice_behavior to identify if it's Zero-Tracker or Standard Load using (EU and US value)*/
//isfunctionalallowed =  (pref != undefined && pref.match(/\b2\b/) || (pref == undefined && experience.match(/\b[^;]*\bus\b/)));

return !!isfunctionalallowed;

Option 2: Using consentModel and trackerConsent

IMPORTANT: This option allows for more granular configuration by country, US state, or Canadian province. Adjust the code snippet according to your Consent Manager Experience. The snippet below provides several options, and we strongly recommend testing to ensure that website visitor preferences are being honored correctly. This includes confirming that tags and cookies are properly blocked or removed when consent is not granted. Please feel free to modify the code as needed to meet your specific requirements.
var pref = _satellite.getVar('trackerConsent');
var experience = _satellite.getVar('consentModel');
var isfunctionalallowed = false;

/*This is the code you can use if you are using consentModel for Zero-Tracker Load Opt-In Countriesn)*/
isfunctionalallowed =  (pref == undefined && experience == 'opt-out') || (pref != undefined && pref.match(/\b2\b/));

return !!isfunctionalallowed;
5
Click Save.
isAdvertisingAllowed

In this Data Element, you add a custom code to check other Data Elements if it allows Functional Cookies, which will return the value 'true' or 'false.'

To configure this Data Element, follow the steps below:

1
In the Data Elements tab, click Add Data Element.
2
Enter the following information in each given fields:
isAdvertisingAllowed data element fields
Name: isAdvertisingAllowed
Extension: Core
Data Element Type: Custom Code
3
Click Open Editor.
4
Enter the code below based on the setup that you want to follow:

Option 1: Using trackerBehavior and trackerConsent

IMPORTANT: The code snippet needs to be adjusted according to your region-based Consent Manager Experience. The snippet below provides several options, and we strongly recommend testing to ensure that the website visitor's preferences are being honored correctly. This includes verifying that tags and cookies are properly blocked or removed when consent is not given. Please feel free to modify the code as needed to meet your specific requirements.
var pref = _satellite.getVar('trackerConsent');
var experience = _satellite.getVar('trackerBehavior');
var isadvertisingallowed = false;

/*This is the code you can use if you are using notice_behavior for Zero-Tracker Load (expressed behavior)*/
isadvertisingallowed = (pref == undefined && experience.match(/\b[^;]*\bimplied\b[^;]*/)) || (pref != undefined && pref.match(/\b3\b/)));

/*This is the code you can use if you are using notice_behavior for Zero-Tracker Load (using EU Manager only)*/
//isadvertisingallowed =  (pref != undefined && pref.match(/\b3\b/)));

/*This is the code you can use if the CM configuration is Implied or Non-ZTL (All Countries)*/
//isadvertisingallowed = (pref == undefined && experience.match(/\b[^;]*\bus\b/)) || (pref != undefined && pref.match(/\b3\b/))));

/*This is the code you can use if you are using notice_behavior to identify if it's Zero-Tracker or Standard Load using (EU and US value)*/
//isadvertisingallowed =  || (pref != undefined && pref.match(/\b3\b/)) || (pref == undefined && experience.match(/\b[^;]*\bus\b/));

return !!isadvertisingallowed;

Option 2: Using consentModel and trackerConsent

IMPORTANT: This option allows for more granular configuration by country, US state, or Canadian province. Adjust the code snippet according to your Consent Manager Experience. The snippet below provides several options, and we strongly recommend testing to ensure that website visitor preferences are being honored correctly. This includes confirming that tags and cookies are properly blocked or removed when consent is not granted. Please feel free to modify the code as needed to meet your specific requirements.
var pref = _satellite.getVar('trackerConsent');
var experience = _satellite.getVar('consentModel');
var isadvertisingallowed = false;

/*This is the code you can use if you are using consentModel for Zero-Tracker Load (Opt-In Countries)*/
isadvertisingallowed =  (pref == undefined && experience == 'opt-out') || (pref != undefined && pref.match(/\b3\b/));

return !!isadvertisingallowed;
5
Click Save.
Setting up a Functional Rule
Standard Event to Fire a Functional Tag
1
Click the Add icon again to add another Event.
2
Enter the following values on each of the given fields:
Functional tag event configuration
Extension: Core
Event Type: Window Loaded
Name: Provide a new event Name or leave it as default.
Order: Set a new Order value or leave it as default.
📋 Note: The default order for all rule components is 50. If two rules have the same event type, the one with the lowest number runs first.
3
Click Keep Changes.
Condition
1
From the Rules tab, open an existing Rule that is considered as a Functional Cookie. For example, GA4 - PageView.
2
Click the Add icon under Conditions.
Add icon under Conditions
3
Enter the following values on each of the given fields:
Functional condition configuration
Logic Type: Regular
Extension: Core
Condition Type: Value Comparison
Name: Level 2 - Condition (Functional)
Left Operand: %isFunctionalAllowed%
Operator: Is True
4
Click Keep Changes.
Setting up an Advertising Rule
Standard Event to Fire an Advertising Tag
1
Click the Add icon again to add an Event.
2
Enter the following values on each of the given fields:
Advertising tag event configuration
Extension: Core
Event Type: Window Loaded
Name: Provide a new event Name or leave it as default.
Order: Set a new Order value or leave it as default.
📋 Note: The default order for all rule components is 50. If two rules have the same event type, the one with the lowest number runs first.
3
Click Keep Changes.
Condition
1
From the Rules tab, open an existing Rule that is considered as a Functional Cookie. For example, Facebook - Page View.
2
Click the Add icon under Conditions.
Add icon under Conditions for advertising rule
3
Enter the following values on each of the given fields:
Advertising condition configuration
Logic Type: Regular
Extension: Core
Condition Type: Value Comparison
Name: Level 3 - Condition (Advertising)
Left Operand: %isAdvertisingAllowed%
Operator: Is True
4
Click Keep Changes.
Implementing ECID Opt-in Services

The Experience Cloud ID (ECID) service, integrated into Adobe Experience Platform's data collection technologies, is designed to manage which Adobe Experience Cloud solutions can create cookies on a web page. This service plays a crucial role in establishing a consent opt-in workflow, allowing you to control the deployment of Adobe product tags both before and after a user provides their consent or expresses their preferences.

By utilizing the ECID service, you can configure your site to permit certain Adobe cookies to load with pre-consent, enabling essential functionalities while still respecting user choice. Subsequently, you can set up rules to ensure that other Adobe product tags are deployed only after the user has granted their consent.

📋 Note: While the ECID service facilitates the management of Adobe cookies based on consent, it does not function as a direct mechanism for gathering user consent preferences or as a repository for these preferences. Its primary purpose is to enable the dynamic control of Adobe product tags in alignment with your established consent framework.
Pre-requisites
1
Adobe Experience Platform Setup – Experience Cloud ID Service extension must be installed.
Experience Cloud ID Service extension
2
Truste Notice Tag – Tag Manager support enabled:
If using the Cookie Consent Manager (Trustarc) extension, Zero Cookie Load should be enabled.
If manually creating/adding notice tag, pass gtm=1 as parameter.
Zero Cookie Load checkbox enabled
Disclaimer: Plugins and browser extensions can block your tag managers and then, block the cookie consent manager. To prevent this behavior, consider adding the Cookie Consent Manager script directly to the HEAD tag of the site code rather than relying solely on the tag manager.
Setup
Configure ECID Service Extension
1
Under Catalog, search and install Experience Cloud ID Service.
Experience Cloud ID Service in catalog
2
Under the Opt In column, select Yes (1) to enable Opt In. Under the Is Opt In Storage Enabled? option, select No (2), then enter %adobePermissions% in the Previous Permissions field (3), and click Save.
ECID Opt In configuration
Create Previous Permissions Function

This function is used to inform ECID about the current permissions for Adobe Products. Whenever the user consents, the settings will be persisted.

1
From the Data Elements tab, click Add Data Element.
2
Enter the following values in each of the given fields:
adobePermissions data element fields
Name: Enter adobePermissions for this data element name.
Extension: Core
Data Element Type: Custom Code
3
Click the </> Open Editor button and enter the following script:
var functionalallowed   = false;
var advertisingallowed = false;

var consentreturn = {
    "aam":      false, //Adobe Audience Manager (AAM) for audience targeting activities
    "aa":       false, //Adobe Analytics (AA)
    "target":   false, //Adobe Target
    "ecid":     false, //Experience Cloud Visitor ID (ECID)
    "adcloud":  false, //Adobe Advertising Cloud
    "campaign": false, //Adobe Campaign Manager
    "livefyre": false  //Livefyre content curation and audience engagement platform
};

if(document.cookie === "") {
  console.log('nocookieset!');
  return consentreturn;
}

functionalallowed = _satellite.getVar('isFunctionalAllowed');
advertisingallowed = _satellite.getVar('isAdvertisingAllowed');

consentreturn = {
    "aam":       advertisingallowed, //Adobe Audience Manager (AAM)
    "aa":        functionalallowed,  //Adobe Analytics (AA)
    "target":    advertisingallowed, //Adobe Target
    "ecid":      advertisingallowed, //Experience Cloud Visitor ID (ECID)
    "adcloud":   advertisingallowed, //Adobe Advertising Cloud
    "campaign":  advertisingallowed, //Adobe Campaign Manager
    "livefyre":  advertisingallowed //Livefyre content curation and audience engagement platform
};

return consentreturn;
4
Click Save to create the data element.
Create Consent Change Rule

This rule listens for consent change events and updates ECID categories to fire accordingly.

First you need to create a data element. This data element is used to inform ECID about consent changes without a page reload.

1
From the Data Elements tab, click Add Data Element.
2
Enter the following values in each of the given fields:
consentChangeECID data element fields
Name: Enter a Name for this data element: consentChangeECID
Extension: Core
Data Element Type: Custom Code
3
Click the </> Open Editor button and enter the following script:
console.log('Executing consentChangeECID');
var adobepermissions = _satellite.getVar('adobePermissions');

// Mapping keys to Adobe Opt-In categories
const categoryMap = adobe.OptInCategories;
const approveList = [];
const denyList = [];

// Loop through the object
for (const [key, value] of Object.entries(adobepermissions)) {
  if (key in adobepermissions) {
    if (value) {
      approveList.push(key);
    } else {
      denyList.push(key);
    }
  }
}

// Build the functions
if (approveList.length > 0) {
  console.log(`adobe.optIn.approve(${JSON.stringify(approveList)}, true);`);
  adobe.optIn.approve(approveList, true);
}
if (denyList.length > 0) {
  console.log(`adobe.optIn.deny(${JSON.stringify(denyList)}, true);`);
  adobe.optIn.deny(denyList, true);
}
console.log('adobe.optIn.complete();');
adobe.optIn.complete();

return true;
4
Click Save to create the data element.

After the steps above are completed, proceed creating the rule.

1
From the list of properties, select a Property where you want to apply the rule.
2
From the Rules tab, click Add Rule.
3
Enter a Name for the rule. For example, Consent Changed for ECID.
4
Click the Add icon under Events.
5
Enter the following values in each of the given fields:
Consent Change rule event configuration
Extension: Core
Event Type: Custom Event
Name: Enter a Name for this event or leave it as default.
Custom Event Type (required): Enter truste-consent-gtm. Ensure that specific elements are selected.
Elements matching the CSS selector: Enter body.
6
Click Keep Changes. This sets the event you want the rule to look for before firing.
7
Click the Add icon under Actions then enter the following values in each of the given fields:
Extension: Core
Action Type: Custom Code
Name: Enter a Name for this action.

For example: Core - Trigger Direct Call

Language: Select JavaScript
Consent Change action configuration
8
Open the Editor and then add the code below:
_satellite.getVar('consentChangeECID');
Using Custom Events for Firing Tags Dynamically
Working with Adobe Event Listener

This rule listens for the adobeDataLayer event, which is fired on consent set and checks if consent cookie is Functional or Advertising level. This is only needed if you are dynamically firing tags after a website visitor changes their preferences.

IMPORTANT: If you have a page reload in place, firing triggers dynamically after a user changes consent is not recommended, as tags will load accordingly once the page loads.
1
Ensure that Adobe Client Data Layer extension is installed. Under Extensions > Catalog, search and install Adobe Client Data Layer.
Adobe Client Data Layer in catalog
2
Click Save to install the Adobe Client Data Layer extension.
Adobe Client Data Layer extension saved
Adding a Dynamic Event Generation for Datalayer

The Dynamic Event Generation for Datalayer pushes custom events to reload the page when an event is pushed to the adobeDataLayer. This allows tags to load dynamically according to the user's preferences. By reloading the page, any additional cookies the user consented to are then executed.

To add this script, follow these steps:

1
From the list of properties, select a Property where you want the rule to be applied.
2
From the Rules tab, click Add Rule.
3
Enter a Name (1) for the load script, such as Dynamic Event Generation for Datalayer.
4
Click the Add (2) icon under Events.
Add icon under Events for datalayer rule
5
Enter the following values in each of the given fields:
Datalayer event configuration
Extension: Core
Event Type: DOM Ready
Name: Enter a new Name for this event or leave it as default.
Order: Set the new Order value or leave it as default.
📋 Note: The default order for all rule components is 50. If two rules have the same event type, the one with the lowest number runs first.
6
Click Keep Changes.
7
Click the Add icon under Actions.
Add icon under Actions for datalayer rule
8
Enter the following values on each of the given fields:
Datalayer action configuration
Extension: Core
Action Type: Custom Code
Name: Enter a new Name for this action or leave it as default.
Language: Select Javascript and Execute globally checkbox.
9
Click </> Open Editor and enter the following code:
var __dispatched__ = {}; //Map of previously dispatched preference levels
/*
First step is to register with the CM API to receive callbacks when a preference update
occurs. You must wait for the CM API (PrivacyManagerAPI object) to exist on the page before
registering.
*/
var __i__ = self.postMessage && setInterval(function() {
    if (self.PrivacyManagerAPI && __i__) {
        var apiObject = {
            PrivacyManagerAPI: {
                action: "getConsentDecision",
                timestamp: new Date().getTime(),
                self: self.location.host
            }
        };
        self.top.postMessage(JSON.stringify(apiObject), "*");
        __i__ = clearInterval(__i__);
    }
}, 50);
/*
Callbacks will occur in the form of a PostMessage event. This code listens for the
appropriately formatted PostMessage event, gets the new consent decision, and then pushes
the events into the Adobe Client Data Layer. Once the event is submitted, that consent decision is
marked in the 'dispatched' map so it does not occur more than once.
*/
self.addEventListener("message", function(e, d) {
    try {
        if (e.data && (d = JSON.parse(e.data)) &&
            (d = d.PrivacyManagerAPI) && d.capabilities &&
            d.action == "getConsentDecision") {
            var newDecision = self.PrivacyManagerAPI.callApi("getGDPRConsentDecision", self.location.host).consentDecision;
            newDecision && newDecision.forEach(function(label) {
                if (!__dispatched__[label]) {
                  self.adobeDataLayer && self.adobeDataLayer.push({ "event": "GDPR Pref Allows " + label});
                  __dispatched__[label] = 1;
                }
            });
        }
    }
    catch (xx) {
        /** not a cm api message **/
    }
});
10
Click Keep Changes. The actions are performed once an event is triggered and all conditions and exceptions are evaluated.
11
Click Save to save the script.
Event Listener for Dynamic Loading Based on Consent
IMPORTANT: Use this if you want to dynamically load tags after a user makes a change to consent. Note that triggering a page reload is not recommended if you are doing so.
Custom Event for Functional Tags
1
From the Rules tab, open an existing Rule that is considered as a Functional Cookie. For example, GA4 - PageView.
2
Click the Add icon under Events.
3
Enter the following values on each of the given fields:
Custom event for functional tags
Extension: Adobe Client Data Layer
Event Type: Data Pushed
Name: GDPR Pref Allows 2
Order: Set a new Order value or leave it as default.
📋 Note: The default order for all rule components is 50. If two rules have the same event type, the one with the lowest number runs first.
Listen to: Select Specific Event in the column and set a value in the Event / Key to register for field; for example, GDPR Pref Allows 2.
4
Click Keep Changes.
Custom Event for Advertising Tags
1
From the Rules tab, open an existing Rule that is considered as a Functional Cookie. For example, Facebook - Page View.
2
Click the Add icon under Events.
Add icon under Events for advertising tag rule
3
Enter the following values on each of the given fields:
Custom event for advertising tags
Extension: Adobe Client Data Layer
Event Type: Data Pushed
Name: GDPR Pref Allows 3
Order: Set a new Order value or leave it as default.
📋 Note: The default order for all rule components is 50. If two rules have the same event type, the one with the lowest number runs first.
Listen to: Select Specific Event in the column and set a value in the Event / Key to register for field; for example, GDPR Pref Allows 3.
4
Click Keep Changes.
Verification and Troubleshooting

This section outlines how to verify a Zero-Tracker integration and some common troubleshooting steps.

Verifying a Zero-Tracker Integration

The process of verifying your Adobe Experience Platform Integration will vary depending on the specifics of your deployment, CM configuration, and overall tools at your disposal. However, in general you will be testing that the correct blocking occurs in three situations:

A new user with Standard Load
A new user with Zero-Tracker Load
Changing the existing consent for each category
A new user with Standard Load

When verifying a new user who should see a Standard Load, we are simply ensuring that all tags are fired as expected on the initial load. You should see the same tags fire after the integration as before the integration.

A new user with Zero-Tracker Load

When verifying a new user who should see a Zero-Tracker Load, we are verifying that all of the tags that have the blocking conditions applied have NOT been fired when coming from a region requiring a Zero-Tracker Load. This should be done before any user interaction with the Consent Manager.

Once consent has been submitted, and if consent has been provided, the appropriate tags should fire on the next page load.

Changing the existing consent for each category

When verifying for a user who has changed their consent we are verifying that the correct tags are blocked or fired based on the change. For example, when verifying the change in consent from Advertising to Functional we would expect to see any Advertising tags NOT to be fired on the next page load. Conversely, a change from Functional to Advertising should cause any Advertising tags to be fired. A change both to and from each consent category is recommended.

IMPORTANT: To ensure consent preferences are appropriately honored, once a tag script or code has been executed on a page (i.e., a tag has fired), you will need to configure an automatic page refresh in order for the new consent preference to be reflected. Failure to execute a refresh will result in the prior tracking behavior (e.g., tracking will continue as if an opt-out had not occurred) to persist until a manual refresh is done by a web visitor themselves.
📋 Note: TrustArc has developed a JavaScript snippet for page reload functionality, which you may use directly or reference for your own implementation. You can view the code at this link.
TrustArc  ·  Cookie Consent Manager — Adobe Experience Platform Integration Guide  ·  www.trustarc.com