Ah, to disable the pixel, I have to return True, otherwise, false!
Case closed!
Indeed confirmed and case closed… (forgot to mark as solved)
@darkallman
I see you used the Avada-Theme for your site. Can you give me a hint on how you used the filter with your cookie banner? Looks like a custom implementation.
Thank you
Sure, I use this plugin:
https://nl.ww.wp.xz.cn/plugins/cookie-notice/
I put this in function.php
add_action( 'wp_enqueue_scripts', 'wc_cookie_consent' );
function wc_cookie_consent () {
// DISABLE FB PIXEL
add_filter('pys_disable_by_gdpr', '__return_true');
if ( function_exists('cn_cookies_accepted') && cn_cookies_accepted() ) {
add_filter('pys_disable_by_gdpr', '__return_false');
}
}
-
This reply was modified 8 years ago by
darkallman.