Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter pakino

    (@pakino)

    to clarify
    I inserti this code in my function.pfp file in child-themes.

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

    I setting this cookies _ga, _gali, _gat, _gid with name Statistici
    end I create consentse Statistici..

    Plugin Author Fernando Claussen

    (@fclaussen)

    Hi @pakino,

    If all those cookies are for the same thing, you can check for only one of them.

    Can you share your site with me?

    Thread Starter pakino

    (@pakino)

    I apologize, but I solved it. It was my mistake, a plugin was used, MonsterInsight, and therefore did not block cookies. Entering the analytics code directly works perfectly.

    Thanks to the availability

    Hi @pakino

    I don’t understand where I should create “statistici”.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cookie Analytics problem’ is closed to new replies.