Replies: 0
Hi,
i need to load 2 JS script (Google Analytics & Facebook Pixel) after the consent.
So, in my functions.php i create a function like this:
add_action( ‘wp_footer’, ‘analitiche’ );
function analitiche() {
if ( function_exists(‘cookie_accepted’) && cookie_accepted() ) { ?>
// my js snippets
}
But this not works with a caching plugin (Comet Cache), is there a solution?
Thanks.