Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!

Google Consent mode v2 implementation using Adobe Launch

Avatar

Level 2

Hi All,

 

Anyone done poc/pov/implementation for Google consent mode v2 implementation using Adobe launch .

 

I got some soultion using below code

gtag('consent', 'default', {
  'ad_storage': 'denied',
  'analytics_storage': 'denied'
});

but anyone recent done same approach. 

 

Thanks & Regards,

Madhusudan Sura | +919423067216

 

Thanks & Regards,

Madhusudan Sura | +919423067216

 

5 Replies

Avatar

Community Advisor

Hi @Madhusudan_S 

I implemented something like this for a client and seems to work, given that the Data Element "consent" is an object, containing your user's currently given consent with attributes "marketing", "analytics" and "personalization".

 

/**
 * Sample "consent" Data Element response
 * {
 *   marketing: true,
 *   analytics: false,
 *   personalization: true,
 * }
 */
const consent = _satellite.getVar("consent", event) || {};

gtag('consent', 'default', {
    'ad_storage': consent.marketing ? 'granted' : 'denied',
    'analytics_storage': consent.analytics ? 'granted' : 'denied',
    'ad_user_data': consent.marketing ? 'granted' : 'denied',
    'ad_personalization': consent.personalization ? 'granted' : 'denied',
    'wait_for_update': 500
});

 

 

Alternatively to or in combination with the dedicated "consent" Data Element, you can also use the approach @FarazHusain suggested in combination with above code, using the "adobe.optIn" API

to map the values. However, I prefer having one Data Element that is used as base for both the Adobe API and the Google Consent Mode.


Hope that helps,
Björn

Cheers from Switzerland!


Avatar

Community Advisor and Adobe Champion

I second the dedicated "consent" Data Element... process the consent once, then use for everything...  if you need to make changes or updates, it's in one place.

Avatar

Level 1

So where is this implemented? As a condition for the Google related rules?

Avatar

Community Advisor

@fahadharur1  you will need to inject this on page load or at least, before you load any google library

Cheers from Switzerland!