Usercentrics CMP currently maps the values of the consent update event as follows:
| Name | Template Id | Consent Type |
| Conversion Linker | LykAT-gy | ad_storage |
| Display & Video 360 | UekC8ye4S | ad_storage |
| Google Ads | S1_9Vsuj-Q | ad_storage |
| Google Ads Conversion Tracking | twMyStLkn | ad_storage |
| Google Ads Remarketing | B1Hk_zoTX | ad_storage |
| Google Analytics | HkocEodjb7 | analytics_storage |
| Google Analytics 4 | 87JYasXPF | analytics_storage |
| Google Campaign Manager 360 | dyHOCwp5Y | ad_storage |
| Search Ads 360 | DHS2sEi4b | ad_storage |
The remaining parameters for Google Consent mode V2, will follow the value set for ad_storage. The privacy parameters (functionality_storage, personalization_storage, and security_storage) are not updated as they are not part of Google Consent Mode and not affect tracking behavior.
In case you want to base the update events on different services or to custom ones, you can use an event listener and the following remap script to match your needs. In order to do this, deactivate the Google Consent mode toggle in Configuration > CMP Settings. This will stop the banner from setting the consent update event.
Following the path Implementation > Data Layer & Events, create a new window event.
Attention: Please make sure to add only one event listener, additional listeners that produce update events might disrupt Google tracking.
REMAP TO A CUSTOM SERVICE
To base the consent to one service, add the name within the squared brackets, as it is read in the admin interface and the dataLayer event. Implement the code on the page, preferably before the banner script. If the parameter is not needed you can delete it from from the serviceMap object.
<script>
window.addEventListener("ucEvent", function(e) {
// Only proceed if event exists, is a consent update, and is explicit
if (e.detail && e.detail.event === "consent_status" && e.detail.type.toLowerCase() === 'explicit') {
// Map GCM v2 keys directly to your CMP service names
var serviceMap = {
ad_user_data: 'SERVICE NAME',
ad_personalization: 'SERVICE NAME',
ad_storage: 'SERVICE NAME',
analytics_storage: 'SERVICE NAME',
functionality_storage: 'SERVICE NAME',
personalization_storage: 'SERVICE NAME',
security_storage: 'SERVICE NAME'
};
// Build the consent update object dynamically
var consentUpdate = {};
Object.entries(serviceMap).forEach(([consentSignal, serviceName]) => {
if (serviceName && e.detail.hasOwnProperty(serviceName)) {
consentUpdate[consentSignal] = e.detail[serviceName] ? 'granted' : 'denied';
}
});
// Update Google Consent Mode if at least one category exists
if (Object.keys(consentUpdate).length > 0) {
gtag('consent', 'update', consentUpdate);
}
}
});
</script>REMAP TO UPDATE PRIVACY PARAMETERS
The same event can also be used to update a subset of parameters like the privacy parameters (functionality_storage, personalization_storage, and security_storage) that are currently not updated natively by our banner. In this case, you can leave the native GCM mechanism active in the admin interface and leave inside the serviceMap object only the 3 mentioned parameters. Doing otherwise will result in a double update event that can influence the tracking of Google products.
<script>
window.addEventListener("ucEvent", function(e) {
// Only proceed if event exists, is a consent update, and is explicit
if (e.detail && e.detail.event === "consent_status" && e.detail.type.toLowerCase() === 'explicit') {
// Map GCM v2 keys directly to your CMP service names
var serviceMap = {
functionality_storage: 'SERVICE NAME',
personalization_storage: 'SERVICE NAME',
security_storage: 'SERVICE NAME'
};
// Build the consent update object dynamically
var consentUpdate = {};
Object.entries(serviceMap).forEach(([consentSignal, serviceName]) => {
if (serviceName && e.detail.hasOwnProperty(serviceName)) {
consentUpdate[consentSignal] = e.detail[serviceName] ? 'granted' : 'denied';
}
});
// Update Google Consent Mode if at least one category exists
if (Object.keys(consentUpdate).length > 0) {
gtag('consent', 'update', consentUpdate);
}
}
});
</script>REMAP TO MULTIPLE SERVICES
Alternatively, you can use an event listener to map multiple custom Usercentrics consents to the corresponding Google Consent Mode storage types. In this case, each storage type (e.g. ad_storage, functionality_storage) is granted only if all required consents are explicitly accepted, otherwise, it is denied.
window.addEventListener('ucEvent', e => {
const c = e.detail;
// Only proceed if c exists, event is 'consent_status', and type is explicit
if (c && c.event === 'consent_status' && c.type && c.type.toLowerCase() === 'explicit')
gtag('consent', 'update', {
ad_storage: (c["TikTok Advertising"] && c["Reddit Advertising"]) ? 'granted' : 'denied',
functionality_storage: (c["Live Chat"] && c["Customer Support Tools"]) ? 'granted' : 'denied'
});
});This pattern can be reused for any Google Consent Mode storage type by changing the consent names and the storage key.