Support » Plugin: GDPR Cookie Compliance (CCPA, PIPEDA ready) » Cloudflare cache and fb pixel disable

  • Resolved cekaraz

    (@cekaraz)


    Hi the`re, I am using your plugin with cloudflare caching.
    I am using this code snippet that you suggested in a previous topic:

    add_filter('gdpr_cookie_script_cache','gdpr_prevent_script_cache');
    function gdpr_prevent_script_cache() {
      return array();
    }
    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' );

    to disable FB pixel when users rejects third party plugin.
    The problem is this works as long as I disable cloudflare caching.
    When I enable it, the website returns the same cached version of the website with the pixel code, regardless of the user setting.
    Any idea of a possible workaround ?

    Thanks you!

Viewing 1 replies (of 1 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @cekaraz,

    Thanks for using our plugins.

    The function gdpr_cookie_is_accepted is using PHP cookie variables to check if the cookies are diabled or not. You can try to exclude the PHP cookies from cloudflare caching, speak to your hosting support or cloudflare support to help you with this. An alternative solution would be to remove the woocommerce pixel plugin from your site, and add the facebook tracking to GDPR Cookie Compliance settings.

    Hoep this helps.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.