Support » Plugin: GDPR » AdSense ads on Sidebar and In-Article

  • Hello all,

    did anyone using Google AdSense manage to block their ads before getting the consent from their users? I created an “adsense” cookie category and placed the ad code between theif code provided, using the right cookie category, but it didn’t work (I suppose this is because the widget is written in HTML, but I’m no programmer and I could very well be wrong).

    I’m currently using Cookiebot (I very recently tweaked a few things on my site so that that plugin doesn’t work either anymore though…) but I’d like to switch to this one because it gives so much more control (I’d resize the full-screen Privacy Policy acceptance popup though, it can take a toll on views).

    Any suggestions for a newbie like me? Thanks!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter lucydeetz

    (@lucydeetz)

    Update: I successfully managed to block the cookies in the “analytics” category, but the problem is that these cookies aren’t being set anymore even after I’ve given consent to that category. It looks like the cookies are still being blocked. Instead, three cookies from this plugin appear.
    Any help?

    Plugin Author Fernando Claussen

    (@fclaussen)

    Hi @lucydeetz,
    How did you block those?

    Thread Starter lucydeetz

    (@lucydeetz)

    Hi @fclaussen,

    I used the if code I found in the documentation on the plugin’s website and changed the UA with my Analytics number. I’m using the gtag in the header section and at first I had moved and wrapped this code in an if statement in my functions.php, but it didn’t work, so I copied off the one provided and left the gtag in the header section.
    It does work now, as no Analytics cookies are set prior to clicking on “I agree”, but after clicking on the button, I still see no _ga cookie on Chrome (I click the green lock next to the URL bar to view the active cookies). There are three new cookies though that are set by the GDPR plugin (for example, one of them “gdpr[allowed_cookies]”). Are the cookies for GA “nested” into these somehow?

    Thanks!

    • This reply was modified 3 years, 6 months ago by lucydeetz.
    • This reply was modified 3 years, 6 months ago by lucydeetz.
    Plugin Author Fernando Claussen

    (@fclaussen)

    These cookies that the plugin set is a simple list of cookies that are allowed to be set. If _ga is in there, it will be allowed.

    I wanted to review your if statements to see if that was done correctly.

    Thread Starter lucydeetz

    (@lucydeetz)

    Hi Fernando,

    The code is as follows:

    add_action( 'wp_head', 'my_google_opt_out' );
    function my_google_opt_out() {
     if ( ! has_consent( 'analytics' ) || ! is_allowed_cookie( '_ga' ) ) {
        ?>
        <script>
          window['ga-disable-UA-XXX-X'] = true; // Don't forget to replace X for your actual UA numbers.
        </script>
        <?php
      }
    }

    The cookies from GA are the only ones that I have to block, as I decided to get rid of Adsense for the time being. The cookies that are set by GDPR do list all the cookies from Analytics in their description, does that mean those cookies are active even if Chrome doesn’t detect them? If so, wonderful!

    • This reply was modified 3 years, 6 months ago by lucydeetz.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘AdSense ads on Sidebar and In-Article’ is closed to new replies.