• Resolved PapGeo

    (@papgeo)


    Can I configure the plugin to serve non-personalized Adsense ads before user consent (with new “requestNonPersonalizedAds” parameter) and serve personalized ads after consent?

Viewing 1 replies (of 1 total)
  • Plugin Author cookiebot

    (@cookiebot)

    Hi @papgeo

    You can use Cookiebots API to render code depending on the users consent.

    On page load you could use something like:

    function CookiebotCallback_OnDialogInit() {
    
      var requestPersonalizedAds = 0;
    
      if (Cookiebot.marketing) {
        requestPersonalizedAds = 1;
      }
    
      (adsbygoogle = window.adsbygoogle || []).requestNonPersonalizedAds = requestPersonalizedAds;
    
    }

    If the user changes consent there is a callback for that as well, where you could check the new consent state, and render AdSense accordingly.

    Callback name: CookiebotCallback_OnAccept

    • This reply was modified 6 years, 5 months ago by cookiebot.
Viewing 1 replies (of 1 total)
  • The topic ‘Non-Personalized Ads’ is closed to new replies.