Facebook Tracking Pixels

You can add Facebook Tracking Pixels to your responsive site to track events. Create your Facebook Tracking Pixel code in the Facebook Pixel tab.

Add Facebook Tracking Pixel

Script Section
<!-- 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', 'XXXXXXXXXXXXXXX');fbq('track', 'PageView');
</script>
NoScript Section
<noscript>
<img height="1" width="1" style="display:none" 
src="https://www.facebook.com/tr?id=XXXXXXXXXXXXXXX&amp;ev=PageView&amp;noscript=1"/>
</noscript>
<!-- End Facebook Pixel Code -->
  1. To access the HTML Header section, in the left panel, click Settings, and then click Header HTML.
  2. Copy the <script> part of the code provided by Facebook into the header HTML section, and then click Save. The code should look similar to the one below.

    Note

    All of the above code is just an example - do not copy this directly into your site. Please be sure to obtain the correct code from Facebook Pixel Code.

  3. Navigate to Developer Mode by clicking on the </> symbol in the top bar.

  4. Expand the Site HTML/CSS section, and click body-end.html. Place the noscript part of the code in this section. Then, click Save. This section should now look like this:

Considerations for Facebook Tracking Pixels

  • Similar to Google Tag Manager, Facebook recommends to place the noscript code in the beginning of the body section. This is a workaround they suggests to get around limitations of old web browsers which do not load header code.
  • Duda has completed extensive testing and the body-end.html section of developer mode works for adding the noscript code.
  • For more information about Facebook Pixel Implementation, see this guide.
Was this article helpful?
1 out of 1 found this helpful

Feedback on this article

0 comments

Please sign in to leave a comment.

×

Please Log in as a Pro

Priority Phone Support is available exclusively to Pros. Log in to your Pro account now to see our international support numbers.

Log In
Not a Pro? Purchase a Pro plan!