Add a Facebook/Meta Pixel

The fifth tutorial shows how to add the Facebook Pixel to your codebase for tracking conversions from Facebook ad campaigns.

Thomas Rocca avatar
Written by Thomas Rocca
Updated over a week ago

This is the fifth tutorial in the low-code development series. Follow-along to learn how to create a Facebook or Meta Pixel and then add it to your codebase. This Pixel helps you assess the success of your Facebook ad campaigns by tracking key events that happen on your marketplace, like a listing being created or order being placed


  1. Configure Facebook Pixel (00:46)

  2. Add the Pixel to your codebase (01:14)

Resources used in this video

There are two code snippets used in the video. You can copy them from below:

Code snippet one: Tracking code script

Remember to replace REPLACE_THIS_VALUE with your Facebook Pixel ID:

<script key='fb'>
s.parentNode.insertBefore(t,s)}(window, document,'script',
fbq('init', 'REPLACE_THIS_VALUE');
fbq('track', 'PageView');
<noscript key='fb-img'>{`<img height="1" width="1" style="display:none"

Code snippet two: Safelist Facebook in the content security policy

 const { imgSrc = [self] } = defaultDirectives;
const imgSrcOverride = imgSrc.concat('');

const { scriptSrc = [self] } = defaultDirectives;
const scriptSrcOverride = scriptSrc.concat('', '');

const { frameSrc = [self ] } = defaultDirectives;
const frameSrcOverride = frameSrc.concat('', '');

const { connectSrc = [self] } = defaultDirectives;
const connectSrcOverride = connectSrc.concat('');

const customDirectives = {
// Example: Add custom directive override
imgSrc: imgSrcOverride,
scriptSrc: scriptSrcOverride,
frameSrc: frameSrcOverride,
connectSrc: connectSrcOverride

Additional developer documentation

More information on analytics and integrations can be found in Sharetribe's Developer Documentation site. We recommend:


This is the final video guide in the low-code developer series. If you would like to go further into making changes using custom code, then we recommend starting and following the three-part developer tutorial on the Developer Documentation site.

Would there be any other low-code topics you would like covered in future videos? Let us know using the chat below.

Did this answer your question?