Search Universal Consent Platform (UCP)
Integrating Google Consent Mode with UCP you can respect the privacy choices of end users with minimal impact on your website's ad-based revenue stream, analytics, and more.
If you're already using Google gtag.js or Google Tag Manager (GTM) on your website, we recommend that you add the Google Consent Mode integration to your website, to ensure you get the best use of your Google Services.
The configuration described in this article works with the following Google tags deployed via gtag.js and 'Web' containers in Google Tag Manager:
Once you’ve implemented the integration on your website, UCP automatically signals the consent choices of your visitors to Google instead of blocking tags when not consented. Google uses the end user's granular consent to adjust tag behavior accordingly. For instance, this means serving personalized ads to visitors that have “opted-in” to marketing vendors and tracking, or instead serving general interest ads relating to the content of your website when a visitor signals an "opt-out".
Without the integration, no ads are typically served, as the scripts serving the ads aren’t allowed to run without consent from marketing vendors. With the Google Consent Mode and UCP integration in place, UCP allows tags to run and Google serves ads and log analytics data according to the UCP signal.
This article by Google describes the technical details of how supported tags change behavior based on the end user's consent.
The Google Consent Mode is an API that UCP integrates with. Once you’ve installed the UCP tag on your site (directly or via the GTM Template Gallery), you can enable the Google Consent API-integration by adding the following code snippet to your UCP Script. You can find the script code here:
Or copy and paste the script code here into your UCP script:
<script> window.dataLayer = window.dataLayer || []; if (typeof gtag !== 'function') function gtag(){dataLayer.push(arguments);} gtag('set', 'developer_id.dOGRkZj', true); gtag('consent', 'default', { 'ad_storage': 'denied', 'analytics_storage': 'denied', 'region': ['AT','BE','BG','CZ','DE','DK','ES','FI','FR','GB','GR','HU','IE','IT','LU','NL','PL','PT','RO','SE', 'BR', 'TH', 'TR'] }); </script>
Note: Make sure to add the above code before your gtag.js or GTM code snippet, and if you've chosen to rename the dataLayer, ensure that you change window.dataLayer to the actual name of the dataLayer.