Support Forum Support Forum GDPR Cookie Compliance ga cookies allowed before accepted

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • May 25, 2021 @ 11:58 am

    hello,

    I have detected that some ga cookies are present prior to acceptance. I am only adding script via this plugin. could it be a caching issue.

    these are the cookies that are present irrespective of acceptance by the user:

    _ga

    content: GA1.2.979534633.1621940137

    _ga_JDRFMNR245

    cotenant: GS1.1.1621939995.1.1.1621941649.0

    _gat

    content: 1

    _gid

    only the gtag is blocked until accepted:

    _gat_gtag_UA_132788688_1

     

    Moove Agency
    May 25, 2021 @ 1:09 pm

    Hi Oliver,

    It could be a server caching issue or you have the GA hardcoded in your site or used within other plugins.

    Also please ensure that the cookies are not accepted by default ( we can’t see the GDPR cookie bar at all in private browsing).

    Hope this helps.

    Premium
    May 25, 2021 @ 4:48 pm

    Hello,

    Thanks for replying. I don’t have GA hardcoded or added via any other plugin so I can only think it is some caching issue then. I have all cookies off by default and have checked that the bar is not set to hidden on any page. Have you heard of issues with caching – we are using SG Optimizer and Cloudflare.

    Is this the code to prevent caching?

    add_filter(‘gdpr_cookie_script_cache’,’gdpr_prevent_script_cache’);
    function gdpr_prevent_script_cache() {
    return array();
    }

    Thanks

    Moove Agency
    May 26, 2021 @ 9:56 am

    Hi Oliver,

    Thanks for the details.

    We have checked your site, and found the Google Analytics tracking script hardcoded. Please check the source-code of your site in your browser, and search for your Google Analytics property ID (in the source code is located in line #506). Our GDPR Cookie Compliance plugin insert the pre-defined scripts via JavaScript, by this it’s not visible in the view-source section of the site.
    In order to get this sorted, please ensure you have no hardcoded GA script in your theme on added by third-party plugins. This reported problem is not related to caching.
    We also noticed, the Google Tag Manager tracking script is defined in GDPR Cookie Compliance plugin, this is working properly, you just have to remove the old GA tracking code. If you can’t locate the tracking script yourself, please speak to your developers to help on this.

    Hope this helps.

    Premium
    May 26, 2021 @ 7:43 pm

    hello, thanks for replying and sorry that I hadn’t noticed this before. I think that I found the culprit: WooCommerce Google Analytics Integration. this plugin has the UA code. Have you come across this one – if I remove the code from the plugin I’m afraid that it will stop sending ecommerce data to GA. Have you come across this before?

    Premium
    June 08, 2021 @ 10:53 am

    Hello guys,

    I can confirm that the issue is with the plugin WooCommerce Google Analytics Integration. I deactivated the UA code in the plugin but now not getting any ecommerce data in Google Analytics. Do you already have a hook for this as I guess it is a fairly common scenario like the Facebook pixel hook.

    Thanks,

    Oliver.

    Moove Agency
    June 08, 2021 @ 12:26 pm

    Hi Oliver,

    Predefined hooks are listed in the Help section of the plugin.

    You can try this ‘Hook for WooCommerce Facebook Pixel plugin’

    add_filter('facebook_for_woocommerce_integration_pixel_enabled', 'gdpr_cookie_facebook_wc', 20);
    function gdpr_cookie_facebook_wc() {
      $enable_fb_wc = true;
      if ( function_exists( 'gdpr_cookie_is_accepted' ) ) :
      $enable_fb_wc = gdpr_cookie_is_accepted( 'thirdparty' );
      endif;
      return $enable_fb_wc;
    }
    add_action( 'gdpr_force_reload', '__return_true' );

    Hope this helps.

    Premium
    June 08, 2021 @ 4:53 pm

    hi yes, I already have that hook implemented. It is good for facebook pixel. My question is related to the WooCommerce Google Analytics Integration plugin.

    thanks.

    Moove Agency
    June 14, 2021 @ 7:22 am

    Hi Oliver,

    Thanks for your comments.

    You can try the following code snippet with WooCommerce Google Analytics:

    add_filter('woocommerce_gtag_snippet', 'gdpr_cookie_wc_gtag_tracking_script', 20, 1);
    function gdpr_cookie_wc_gtag_tracking_script( $gtag_snippet ) {
      $enable_gtag_wc = true;
      if ( function_exists( 'gdpr_cookie_is_accepted' ) ) :
      	$enable_gtag_wc = gdpr_cookie_is_accepted( 'thirdparty' );
      endif;
      return $enable_gtag_wc ? $gtag_snippet : '';
    }

    Hope this helps.

    Premium
    June 14, 2021 @ 4:28 pm

    Yes that seems to do the trick. Thanks.

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘ga cookies allowed before accepted’ is closed to new replies.