Creating and setting up Facebook Pixel
Creating a pixel
To create a pixel, go to Events Manager and press the green key +
Select Web in the window Connection of a new source of data and press Start.
Then, select Facebook Pixel and press Connect.
On the next page, specify the name of a counter and flow or website url and click Continue.
If you're planning to work with a flow, you can finish pixel creation at this stage. Copy its number and insert it in flow settings.

If you placed a landing page on your hosting service, select "Add pixel code to the website manually" in the next window, copy the basic code and insert it on your landing page. Also, you have to add Lead event script to the thank you page.

When you create an ad campaign, select Conversion as a goal
Then, go to Ad groups tab and select previously created pixel.
Adding a pixel when creating a flow
If you're planning to work with a flow – no matter if you drive traffic to our servers or your hosting service – it's enough to specify pixel number in this flow's settings:
Adding a pixel when downloading a landing page to a hosting service
When you download a landing page to a hosting service, put pixel scripts before the </head> closing tag in the files:

- index.php – in the root of a landing page,

- invoice2/index.php – "Thank you" page.

Second option:

- trackers.php – shown on the landing page itself,

- trackers_order.php – on the "Thank you page"

Add basic pixel code with PageView event to 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 code'');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=your pixel code&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
In addition to PageView, you also have to add Lead event to the Thank you page to track 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 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 -->
Dynamic pixel
You can set up a dynamic pixel and change it in the website's url, thus, you can drive traffic to a specific landing page or flow, using different counters.


When you work with a flow, if you want to add a pixel to address, tick the box next to "In URL" box in flow settings in «Counters» section.

\ Then, add the parameter ?fb_pixel=your pixel number (if there're no other parameters in the link yet) or &fb_pixel=your pixel number (if there're other parameters) to the flow link that you're planning to use for your ad campaign. After that, you can change the number in the link without changing anything in a flow.



If you downloaded a landing page, you have to add the following script to trackers_order.php file:

<script>

fbq('track', 'Lead');

</script>



Then, simply add ?fb_pixel=your pixel number (if there're no other parameters in the link yet) or &fb_pixel= your pixel number (if there're other parameters) parameter to your link.

Short pixel
If you download a landing page to your hosting service, you can use a short pixel script. In this case, only Lead event will work on the Thank you page.

Add it to trackers_order.php file or put it before the closing tag </head> 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 -->


How to check if a pixel works correctly
Use Facebook Pixel Helper app.


Follow your link and check if all events are displayed correctly:

- PageView event on the main page of the website:

- PageView and Lead event after an order is placed: