• Resolved steveb123

    (@steveb123)


    Version 2.03

    I have this code in functions.php

    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-XXXXX-4'] = true; // Don't forget to replace X for your actual UA numbers.
            </script>
            <?php
          }
        }
       

    Not only does it block _ga but also all the similar tags -gat,_gat,_gid,_gid

    In addition when I allow it in the front end it is not activated, nor are any of its “siblings”

    I can’t recall the last time that I got so sucked into a plugin, interesting.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Fernando Claussen

    (@fclaussen)

    I need to update the documentation.

    You don’t need to have an ‘analytics’ consent.

    You can just check for the cookies.

    Try updating your code by removing the ! has_consent( 'analytics' ) || bit and see what happens.

    Thread Starter steveb123

    (@steveb123)

    Brilliant That works!

    Thank You

    Thread Starter steveb123

    (@steveb123)

    Resolved

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Error in Admin’ is closed to new replies.