How to integrate with Facebook Pixel

In order to track a Lead event to your Facebook Pixel when someone signs up, you can setup Facebook Pixel integration for your project. 

Getting your Pixel ID and setting up integration

Here's how: 

If you're yet to create your Pixel, follow Facebook's guide on how to create one here (only do the first part - Create a Facebook pixel - then go back here). 


Log in to Facebook and go to Events Manager


From the sidebar navigation, click on the Business Tools button then under Manage Business select Events Manager


You should be able to immediately find your Pixel ID right underneath your Data Source (Pixel) name. Alternatively, you can select it from the list on the left sidebar and then navigate to the Settings tab and under Details you'll find your Pixel ID. Copy it. 


Back in your Prefinery project dashboard, navigate to Integrations > Facebook Pixel and then paste in your Pixel ID on the provided input field as well as modify the Event Name as you see fit. Hit Save when you're done. That's about it!

How Pixel tracking works with Prefinery

Behind the scenes, we fire the following for your pixel:

On signup form impression:

  fbq('track', 'PageView');

On signup form submit:

  fbq('trackCustom', 'EVENT-NAME');
  fbq('track', 'Lead', {content_category: 'Prefinery', content_name: 'EVENT-NAME'});

Where EVENT-NAME is what you type into Prefinery on the Event Name field of the Facebook Pixel Integration page. 

How to add custom tracking

If you want to implement custom tracking for events like button clicks, Prefinery allows you to add your own custom scripts. 

For example, if you want to track a button-click event on the form submit button, as described in the official FB Pixel documentation for conversion tracking here, you'd need to use a custom script like as follows: 

<script type="text/javascript">
  $('#tester_submit').click(function() {
    fbq('track', 'Purchase', {currency: "USD", value: 30.00});

...where tester_submit is the Prefinery form's submit button id attribute value: 

You'd have to add that custom script in either of the following places in your project dashboard: 


Signup Form > JS tab > Impression Tracking Code


Integrations > Code Injection > Footer Code

For more information regarding Code Injection, please see: Customizing your campaign pages via CSS/Script Code Injection

Still need help? How can we help? How can we help?