Crownpeak Employee
Crownpeak Employee

Integrating Google Consent Mode V2 with UCP

    Google Consent Mode v2


    Crownpeak has successfully integrated support for Google Consent Mode version 2 (v2) into its consent management platform. This update allows Crownpeak customers utilizing Google advertising products to seamlessly integrate with the Crownpeak CMP using default configuration settings. The integration with Google's Consent Mode v2 offers website publishers a streamlined method to provide transparency regarding data collection practices and user choices.

    What is Google's Consent Mode v2?

    Google Consent Mode v2 represents an enhanced iteration of Google Consent Mode, designed to assist website publishers and advertisers in obtaining explicit user consent for web tracking, in alignment with privacy regulations such as GDPR. This updated version introduces standardized banners and user controls, simplifying the consent-gathering process for setting cookies and utilizing tracking technologies.

    Implementing Consent Mode v2 enables advertisers to synchronize user consent with Google advertising services, empowering them to generate detailed reports on campaign performance and conversion tracking. Consent Mode v2 facilitates the acquisition of user consent specifically for advertising and analytics cookies in a legally compliant manner under privacy laws.

    What's new in Consent Mode v2?

    Google introduced Consent Mode v2 as an evolution of its existing Consent Mode platform, maintaining alignment with privacy regulations while offering enhanced transparency and control to users. Two significant new parameters have been incorporated:


    This parameter includes the user's consent preference regarding sharing their data with Google's ad services. The possible values are "granted" or "denied," based on user choices collected through the site's cookie consent banner. If consent is denied, Google advertising tags will refrain from collecting or sending identifiable user data.


    This parameter indicates whether a user has opted-in to ad personalization and remarketing. Similar to ad_user_data, it reflects user preferences captured through the consent UI. A value of "denied" will deactivate personalized ad functionality such as remarketing or interest-based targeting.

    How to implement Google Consent Mode v2 with Crownpeak CMP?

    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:

    1. From UCP, navigate to the Manage tab.
    2. From the top right part of the screen, click Get Site Notice Tag.
    3. From the Site Notice Tags drop-down, select Google Consent API.
    4. Copy the script code and paste into your UCP script.

    Or copy and paste the script code here into your UCP 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'', ''ad_user_data'': ''denied'', ''ad_personalization'': ''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''] }

    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.


    Labels (1)

    Can't find what you are looking for?

    Find Answers

    Search our DG Forum to find answers to questions asked by other DG users.

    Ask a Question

    No luck? Ask a question. Our Product and Support teams are monitoring the Forum and typically respond within 48 hours.

    Ask a Question