Meta Pixel Consent Mode
The Meta Pixel Consent Mode feature allows websites to request user consent before using the Meta Pixel for advertising and analytics.
To implement Meta Pixel Consent Mode with Lawwwing, you need to have the Lawwwing script installed on your website. You can follow our installation guides.
Implementing Meta Pixel Consent Mode
Step 1: Locate the Meta Pixel code in your website's header:
<!-- Meta Pixel Code -->
<script>
!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', '<your-facebook-pixel-id-here>');
fbq('track', 'PageView');
</script>
Step 2: Add the following code before the init
call.
fbq('consent','revoke');
The complete code should look like this:
<!-- Meta Pixel Code -->
<script>
!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('consent', 'revoke'); // <--- Add this line
fbq('init', '<your-facebook-pixel-id-here>');
fbq('track', 'PageView');
</script>
Done! You have manually implemented Meta Pixel Consent Mode.
How it works with Lawwwing
When you use Lawwwing to manage cookie consent, Meta Pixel Consent Mode is automatically integrated with the platform. This means Lawwwing will handle and send the user's consent for Meta Pixel according to the cookie preferences you have configured on your website.
For more details on how to make the most of Lawwwing, visit our Configuration section.
If you need further assistance or have questions, feel free to contact us and we will be happy to help 🙂