Hi @annoy,
Thanks for using our plugins.
Our plugin is compatible with Facebook for Woocommerce plugin, you can add the following code snippet to your functions.php
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.
Thread Starter
annoy
(@annoy)
Thank you very much. Ok, i have this code now placed in the Functions.php of my Child Theme. So i guess now i have to activate the Third Party Cookies in your Plugin? And than, do i have to place a code in Head, Body or Footer? Thank you very much
Thread Starter
annoy
(@annoy)
Or did i missed something?
Hi @annoy,
The code snippet was created to disable the Facebook Pixel script if the Third-Party cookies are accepted by your visitors.
We just checked your site, and the third party cookies are not enabled in GDPR Cookie Compliance -> 3rd Party Cookies settings screen.
You can choose ONE of the following options
1. You can enable the 3rd party cookies and in the the “Head scripts” you can add the following script: <script></script>
otherwise the validation doesn’t allow to save and turn on this cookie category. If you choose this option, the code shouldn’t be updated in your functions.php and please ignore the second code snippet.
2. Alternatively, you can keep the implementation as it is, but the code snippet should be updated and insert the Facebook Pixel tracking code based on Strictly Necessary Cookies value:
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( 'strict' );
endif;
return $enable_fb_wc;
}
add_action( 'gdpr_force_reload', '__return_true' );
Hope this helps.
Thread Starter
annoy
(@annoy)
Yes that worked, thank you so much!