Creating and setting up the Facebook Pixel
A pixel set up this way can pass various events (usually Lead and PageView). When configured using this method, for offers where the "Thank You" page is hosted on the advertiser's side (offers with auto-login), the pixel will not trigger on the "Thank You" page (but only on the landing page).

The second setup option, which allows passing events such as "conversion" and "registration", is described in the guide: Setting up the Facebook pixel to work via Conversions API.
Creating a pixel
To create a pixel, go to the Events Manager and click the green + button.
In the "Connect a new data source" window that opens, select "Web" and click "Get Started".

Next choose "Facebook pixel" and press "Connect".
On the next page, you need to specify the name of your tracker, the URL of your flow or website, and then click "Continue".

If you plan to work with a flow, you can finish creating the pixel at this stage. 
Next, copy the pixel ID and paste it into the corresponding field in the flow settings.

If you downloaded the landing page to your own hosting, then in the next window select "Add pixel code to website manually" by clicking "Install code manually", copy the base code, and paste it onto your landing page. You also need to add the "Lead" event script to the "Thank You" page.
When creating an ad campaign, select the "Conversions" objective.
When creating an ad campaign, go to the "Ads" section and select the previously created Pixel.

Adding a pixel when creating a flow
 If you plan to work with a flow (run traffic to our servers or download the flow to your own hosting), you just need to enter the pixel ID in the flow settings in the corresponding field under the "Trackers" section.
IMPORTANT: Adding trackers in flows of offers with redirect landing pages (if there are any in the offer) is restricted: if the advertiser supports pixel transmission, the field for entering the pixel will be active. Also, pay attention to the description on the offer card, which may indicate nuances of how pixels work.

Adding a pixel when downloading a landing page to your hosting
When downloading a landing page to your hosting, the pixel scripts must be placed before the closing </head> tag in the following files:
  • index.php - in the root of the landing page,
  • invoice2/index.php - the "Thank You" page.
The second option is in:
  • trackers.php - displayed on the landing page itself,
  • trackers_order.php - on the "Thank You" page.
The base pixel code containing the PageView event is placed on the main page:
<!-- Facebook 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_pixel_ID');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=your_pixel_ID&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code →

On the "Thank You" page, in addition to PageView, you also need to add the Lead event to track the conversion:
<!-- Facebook 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_pixel_ID');
fbq('track', 'PageView');
</script>
<script>
fbq('track', 'Lead');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=your_pixel_ID&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code →

Dynamic pixel
We have the option to set up a dynamic pixel and pass it via the website URL; this way, you can run traffic to a single landing page/flow using different trackers.

When working with a flow, to output the pixel to the address bar, you need to check the «in URL» box next to the pixel in the «Trackers» section of the flow settings.
After that, append the parameter ?fb_pixel=your_pixel_ID to the flow link you plan to use in the ad campaign (if the link has no other parameters yet) or &fb_pixel=your_pixel_ID (if there are other parameters). Then, you can simply change the ID in the link without changing the flow settings.
If you downloaded the landing page, you do not need to insert codes into the landing page.
Simply append the parameter ?fb_pixel=your_pixel_ID to your link (if the link has no other parameters yet) or &fb_pixel=your_pixel_ID (if there are other parameters).

Short pixel
If you download a landing page to your own hosting, there is an option to install a short pixel script. In this case, only the Lead event will trigger on the "Thank You" page.

To do this, add the script either to the trackers_order.php file or before the closing </head> tag in the invoice2/index.php file:
<!-- Facebook Pixel Code -->
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id= your_pixel_ID&ev=Lead&noscript=1"/>
<!-- End Facebook Pixel Code -->
How to check if the pixel works correctly
To do this, use the Facebook Pixel Helper.

Follow your link and see if all events are displayed correctly:
  • PageView event on the main page of the website:

  • PageView and Lead events after placing an order: