• Resolved m_andrasch

    (@programmieraffe)


    Hello,

    thanks for providing the plugin!

    Is there a cookie banner plugin which is compatible with Woocommerce GAnalytics integration?

    I tried https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/ but the tracking code is loaded via ajax (admin-ajax.php)

    When I add the HTML output from tracking_code_display() to the GDPR cookie compliance hook, tracking_code_display() checks for is_admin() and aborts (because is_admin() is always true for admin-ajax.php).
    https://www.ads-software.com/support/topic/gdpr-cookie-compliance-hooks-code-snippets/

    Right now I got this to work, but it does not work with WP Super Cache e.g.:

    if (gdpr_cookie_is_accepted('thirdparty') == FALSE) {
          $integrations = WC()->integrations->get_integrations();
          remove_action('wp_head', array($integrations['google_analytics'], 'tracking_code_display'), 999999 );
        }
    

    Thanks in advance!

    Best regards,
    Matthias

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @programmieraffe,

    I’m not personally aware of a cookie plugin that could offer the integration you’ve described with regards to Google Analytics. With caching that could be a tricky one as a plugin like WP Super Cache would likely cache the page content preventing the code you’ve referenced from working.

    You’d possibly need to try and find a way to programmatically clear the cache if the user chose the third party option. We’ll leave this topic open for now to see if anyone in the community forums may be able to offer some further guidance on that for you.

    This blog post may also help.

    https://odd.blog/wp-super-cache-developers/

    Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello there,
    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compatibility with cookie banner plugins? (GDPR)’ is closed to new replies.