• Resolved Bruce Gerencser

    (@brucegerencser)


    I’m having a problem with a troll filing complaints with my hosting provider, Siteground, about my site’s use of cookies. I’m on round three. Their support staff says that JETPACK (or some parts of it) is loading before approval. I need to change this behavior.

    your help is appreciated.

    Bruce Gerencser

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support markomiljanovic

    (@markomiljanovic)

    Hi @brucegerencser,

    The behavior you’re seeing is Jetpack’s stats feature: on page load it requests a script from stats.wp.com and fires a pageview beacon to pixel.wp.com before the visitor makes a consent choice.

    WPConsent wasn’t catching it because Jetpack’s stats service isn’t in its built-in list, so you can add it yourself with a small snippet.

    To prevent this, Add the following script to your website:

    add_filter( 'wpconsent_blocked_scripts', function ( $scripts ) {
          $scripts['statistics']['statistics'] = array(
                  'label'   => 'Jetpack Stats',
                  'scripts' => array( 'stats.wp.com', '_stq' ),
          );
          return $scripts;
    } );

    You can add your custom script in your theme functions.php file or using a code snippets plugin like WPCode. For more options on how to add custom code to your site check out this article: https://wpcode.com/how-to-add-custom-code-in-wordpress/

    We will look into automating this process anyway but for you you can use this snippet.

    Let me know if you run into any issues.

    Thanks,

    Thread Starter Bruce Gerencser

    (@brucegerencser)

    Thank you for your help. The code worked! Siteground support now says my site is compliant.

    Bruce Gerencser

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

You must be logged in to reply to this topic.