Update time: July 18, 2023
This method only works with Web SDK.
This article introduces TrustArc integrates with Experience Cloud ID Service to implement Cookie Banner settings.
The effect is: when the user refuses, Adobe Analytics will not track, and when the user agrees, Adobe Analytics will track.
What is TrustArc
TrustArc Inc. (formerly TRUSTe) is a privacy compliance technology company based in Walnut Creek, California. The company provides software and services to help corporations update their privacy management processes so they comply with government laws and best practices
Principle Analysis
There is an event cookie_prefs_set that is sent through dataLayer.push after the user click agree, and then written authorization information into the cookie, including 2 means that analytics tracking is allowed, so you can use the event cookie_prefs_set and cookie cmapi_cookie_privacy to set:
- For the first page: trigger is event cookie_prefs_set, and cookie cmapi_cookie_privacy contains 2
- For other pages or event: Add one more condition to Rules, and trigger if cmapi_cookie_privacy contains 2.
Detailed Configuration Process
TrustArc Cookie Consent Manager Configuration
Search for Cookie Consent Manager in Adobe Launch Extensions and install it. No extra settings are required.
Configure TrustArc Rules:
Set the Order of Core – Library Loaded (Page Top) as small as possible to ensure that the Rule executes faster.
Cookie Consent Manager – Managed Service Consent Script is set based on TrustArc‘s js.
Experience Cloud ID Service Configuration
Search for Experience Cloud ID Service in Adobe Launch Extensions and install it. Make the following configuration in Opt In:
Selecting Yes in Enable Opt In means that the user’s consent is required before the Experience Cloud ID Service can be executed.
Previous Permissions is to set the tracking of the default Adobe products. Generally, it is not tracked by default. It is set to { aa: false, ecid: false}, which ensures that the data will not be tracked when page open, and it will be updated when the user agrees, such as { aa: true, ecid: true}, which allows tracking.
The code in the data element adobeServicesOptIn is:
var consentGroups=_satellite.cookie.get("cmapi_cookie_privacy"); var consent=false //false by default if(consentGroups && consentGroups.indexOf("2")!=-1){ var consent=true return { aa: consent, ecid: consent }; }else{ return { aa: consent, ecid: consent }; }
2 means analysis is allowed.
Adjust Rule
There is an event cookie_prefs_set that is sent after the user click agree, and then written authorization informationinto the cookie, so you can use the event cookie_prefs_set and cookie cmapi_cookie_privacy to set:
- For the first page: trigger is event cookie_prefs_set, and cookie cmapi_cookie_privacy contains 2
- For other pages or event: Add one more condition to Rules, and trigger if cmapi_cookie_privacy contains 2.
First page
To use cookie_prefs_set event, Google Data Layer Extension needs to be installed. After installation, add the following configuration to the Rule event of the basic PV:
In this way, the tracking of the page can be realized with one click to agree.
And there will be no reload page.
Other Page
Make the following configurations in all Rule conditions:
Note: Regex needs to be checked.
The function of this configuration is: only the information agreed by the user in the cookie can be tracked by AA.
2 means analysis is allowed. Only those that allow analysis and tracking can trigger execution.
Test
When loading by default, previousPermission is false: