Pixel Caffeine and similar plugins - How to block before consent?

287 views
Skip to first unread message

Pol Cousineau

unread,
Jun 11, 2018, 11:52:47 PM6/11/18
to Cookie Control Support
There is an example in the documentation on how to configure the Facebook Pixel, but it doesn't give an example for the WordPress Plugin. It also seems to be only functional for the Page View event and not other events like Lead.

We're currently using Pixel Caffeine Plugin and in some instances it may drop the Facebook FR cookie without consent. I thought CookieControl would block the cookies entered from being created.

How are we able to research the script run by plugins (such as Pixel Caffeine) to enable / disable with Cookie Control?

Is there a way we can simply change the priority level of Cookie Control to ensure it loads prior to the plugin and that it would block/kill any FR cookies from being created without the consent?

If none of these are possible, what would be an example of the configure to use for the Facebook Pixel View event within the Cookie Control WordPress plugin?

Thanks

Afroditi

unread,
Jun 12, 2018, 3:26:08 AM6/12/18
to Cookie Control Support
Hello Pol,
you need to disable to Pixel Caffeine Plugin and run the FB pixel code only inside the Cookie Control accept function. 
Same if you use for example MonsterInsights Analytics plugin for google analytics. 
Best Regards
Afroditi

Pol Cousineau

unread,
Jun 12, 2018, 9:44:02 AM6/12/18
to Cookie Control Support
Thanks for this. I am trying to do this within the WordPress Plugin but not having success.

I already have a Callback script on accept / revoke for ActiveCampaign tracking in my "Marketing" category. I want to add the Facebook Pixel script here. What is the way to write it when using Cookie Control Plugin?

I tried...

Accept:

               // Add Facebook Pixel
function(){
                !function(f,b,e,v,n,t,s)
                {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
                    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
                    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
                    n.queue=[];t=b.createElement(e);t.async=!0;
                    t.src=v;s=b.getElementsByTagName(e)[0];
                    s.parentNode.insertBefore(t,s)}(window,document,'script',
                    'https://connect.facebook.net/en_US/fbevents.js');
                fbq('init', '112725689331944');
                fbq('track', 'PageView');
                fbq('consent', 'grant');
}
                // End Facebook Pixel

OR

               // Add Facebook Pixel
                !function(f,b,e,v,n,t,s)
                {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
                    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
                    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
                    n.queue=[];t=b.createElement(e);t.async=!0;
                    t.src=v;s=b.getElementsByTagName(e)[0];
                    s.parentNode.insertBefore(t,s)}(window,document,'script',
                    'https://connect.facebook.net/en_US/fbevents.js');
                fbq('init', '112725689331944');
                fbq('track', 'PageView');
                fbq('consent', 'grant');
                // End Facebook Pixel


Revoke:
// Revoke Facebook Pixel
            fbq('consent', 'revoke');

This breaks cookie control.

Afroditi

unread,
Jun 12, 2018, 9:55:07 AM6/12/18
to Cookie Control Support
Hello Pol,
try to add the following code without the comment lines

!function(f,b,e,v,n,t,s)
                {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
                    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
                    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
                    n.queue=[];t=b.createElement(e);t.async=!0;
                    t.src=v;s=b.getElementsByTagName(e)[0];
                    s.parentNode.insertBefore(t,s)}(window,document,'script',
                    'https://connect.facebook.net/en_US/fbevents.js');
                fbq('init', '112725689331944');
                fbq('track', 'PageView');
                fbq('consent', 'grant');


Best Regards
Afroditi

Pol Cousineau

unread,
Jun 12, 2018, 10:37:25 AM6/12/18
to Cookie Control Support
That worked perfect. Thank you!

Webmaster Blackraven

unread,
Jun 26, 2018, 9:08:12 AM6/26/18
to Cookie Control Support
Thanks Afroditi was getting really frustrated with the Support answer not working correctly, who would have thought it was down to the blasted comments !
Reply all
Reply to author
Forward
0 new messages