Installing FB pixel in Keitaro tracker
When you download a landing page to Keitaro, there're several methods of installing FB pixel: statistical and dynamic. You can also add a standard (full) pixel or a short one.
Static full pixel
You need to put pixel scripts before the </head> closing tags in the files:
- index.php - in the root of a landing page,
- invoice2/index.php - "Thank you" page

Second option - in:
- trackers.php - is displayed on a landing page itself,
- trackers_order.php - on the "Thank you" page
Install basic pixel code with PageView event 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_number');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=your_pixel_number&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
You need to add Lead event to the "Thank you" page in addition to PageView event so that you can track conversions:

<!-- 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_number');
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_number&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code →
Static short pixel
In this case, only Lead event will work on "Thank you" page.

Add code to trackers_order.php file or before the </head> closing tag in invoice2/index.php file.
<!-- Facebook Pixel Code -->
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=your_pixel_number&ev=Lead&noscript=1"/>
<!-- End Facebook Pixel Code -->
Dynamic full pixel
It's possible to install a dynamic pixel and change it in the website URL. Thus, you can drive traffic to a landing page using different ad flows at the same time.

You need to add the following parameter - ?fb_pixel=your_pixel_number (if there're no other parameters in a link) or &fb_pixel=your_pixel_number (if there're other parameters in a link) – to the link of a landing page which you're planning to use for an ad campaign. Then, you can change the number in the link without doing anything with a landing page itself.

At the same time, the pixel code shown above, will be generated for the needed pages with pixel number in URL:

- Basic pixel code containing PageView event will be added to the main page.
- PageView and Lead events will be added to thank you page to track conversions.
Dynamic short pixel
To install it and ensure its proper functioning you have to edit code in two files.
In the file pieces/fb_pixel.php, use the following code:

<?php if (isset($lead)): ?>
<img height="1" width="1" src="https://www.facebook.com/tr?id=<?= $fb_pixel ?>&ev=Lead=1"/>
<?php endif ?>
In the file pieces/trackers/fb_pixel.php, use the following code:

<?php if (isset($lead)): ?>
<img height="1" width="1" src="https://www.facebook.com/tr?id=<?= $pixel_id ?>&ev=Lead=1"/>
<?php endif ?>
Also, you can replace Lead event with any other one.
How to check if a pixel works correctly
Use Facebook Pixel Helper app.

Follow your link, place a test order and check if events are displayed correctly:
- PageView event on the main page if a pixel is full:
- PageView and Lead events on "Thank page" after placing an order (full pixel):
- Lead events on "Thank you" page (short pixel):