How can I add Facebook Pixel tracking code to a form?

  • Profile Image
    mmckelvey
    Asked on January 20, 2018 at 01:16 AM

    Was hoping to add a Facebook Pixel tracking code so it could integrate with Facebook Ads Manager. Is there a way to do that? I see the Google Analytics widget, but not seeing one for facebook :(

    <!-- Example -->
    !DOCTYPE html>
    <html lang="en">
    <head>
    <script>...</script>
    insert_pixel_code_here
    </head>
     
    Thanks!
  • Profile Image
    Jan
    Answered on January 20, 2018 at 01:35 PM

    Unfortunately, it is not possible to insert the Facebook pixel code on the form. According to Facebook guide, the pixel code should be inserted in the head element. There's currently no option in the Form Builder where you can insert a code in the head element.

    You may download the form's source code and edit the HTML, CSS and Javascript files. After that, you can upload it to your servers.

    You can also use the Thank You page to redirect to a custom URL where the Facebook pixel tracking code is. You just need to create a page, put the pixel on it, and then upload it to your web server. After that, you can redirect the Thank You page to that file.

    My colleague Mike mentioned on this thread that it is possible to insert a Facebook pixel code using the noscript image tracking. You just need to get the tracking pixel image code that is located in between the tags. Here's an example:

    <noscript>

    <img height="1" width="1" style="display:none;" src="https://www.facebook.com/tr?id=1234567890&ev=PageView&noscript=1"/>

    </noscript>

    After that, you need to use the Text tool's Source Code and insert the image tracking code. Here's a screen capture:

     

    Hope that helps. Let us know if you have any questions. Thank you.