3

AdSense offers a simple solution for GDPR-compliant messages for personalized ads (https://support.google.com/adsense/answer/10961068).

If I enable this popup, do I need an additional popup implemented for GA4 (Google Analytics), or will GA4 be controlled by this consent message?

I have read a bit about the consent mode, but I do not understand it fully. Will this work out of the box and will consent GDPR message from AdSense also control GA4 collection?

I have found this page from Google: https://developers.google.com/tag-platform/devguides/consent

Here it is explained how to configure Google Analytics to work with consent mode, but is AdSense GDPR message consent mode compatible CMP?

2 Answers 2

2

It looks like Google Analytics and Adsense adhere to TCF v2.0 which is a standard for consent management.

According to this documentation https://support.google.com/analytics/answer/10022331?hl=en if you set the variable window.gtag_enable_tcf_support to true, this will make it Google Analytics compatible with the TCF v2.0 signals.

If I understand correctly, consent values 'TC strings' should flow through from whatever Consent Management Platform (CMP) you are using to anything that's compatible with TCF 2.0. In the case of the default Adsense CMP, it's the one you enable in your account to display GDPR consent message.

Example code from here:

<script>

    <!-- Enabled tcf support for Google tag -->
    window ['gtag_enable_tcf_support'] = true;  

 </script>

 
<!-- Google tag (gtag.js) – Google Ads: TAG_ID -->

  <script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>

  <script>

    window.dataLayer = window.dataLayer || [];

    function gtag(){dataLayer.push(arguments);}

    gtag('js', new Date());

 
    gtag('config','TAG_ID');

  </script>

This assumes you're using Google tag to serve your adsense and google analytics, which I think by default the code they give are Google tags.

Please correct me if I'm wrong.

1
1

https://developers.google.com/funding-choices/fc-api-docs gives you a starting point...

I figured out a code that so far works good but I'll give it some testing time. BTW, I don't like at all GA4. I'm considering switching to other alternative (but there are no alternatives that I know of...)

1
  • Hi! Thank you very much for this very useful link. Did you need to manually disable/enable GA4 using JavaScript events described on the page, or does this happen automatically with Google's tags and consent mode or some other mechanism?
    – Klemen
    Jun 15, 2023 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.