How to Add Facebook Pixel to Your Website

Created by PX Marketing, Modified on Tue, 19 Aug at 5:05 PM by PX Marketing

Overview

If you’re running ads on Facebook, adding the Facebook Pixel to your PXME website is essential. The Pixel (and optional Conversion API) allows you to send event data to Facebook for improved tracking, deeper insights, and more effective ad optimization.


Key Features

  • Pixel Integration – Add your Facebook Pixel ID to track events directly from your site

  • Conversion API Support – Send data from your server to Facebook for more reliable event tracking

  • Flexible Tracking Options – Apply tracking at the funnel/website level or on specific pages

  • Event Types – Track page views, form submissions, order completions, and more

  • Multiple Pixel Support – Add and manage more than one Pixel ID in a single place

  • Summary Table – View all your tracking configurations in one organized dashboard


Step 1: Add the Facebook Pixel

  1. Log in and go to Sites > Websites

  2. Open the funnel or website you want to track

  3. In the overview screen, click the Events tab

  4. Click Add Event and enter your Pixel ID

  5. Choose Tracking Level (funnel/website-wide or specific pages)

  6. To use the Conversion API, enable the option and enter your Access Token

  7. Save your changes

You can add multiple Pixel IDs and manage them in the summary table.


Step 2: Add Event-Specific Tracking to Pages

For actions like Opt-Ins, Purchases, or Leads, event-specific code may be required.

  1. Go to the Step where the event occurs (e.g., a Thank You page for Leads)

  2. Click Edit

  3. Select Tracking Code from the left menu

  4. In Footer Code, paste the event script (see examples below)

  5. Save your changes


Pixel & Event Code Resources

Base Facebook Pixel Code

(Replace IDHERE with your Pixel ID)

<!-- 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', 'IDHERE'); fbq('track', 'PageView'); </script> <noscript> <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=IDHERE&ev=PageView&noscript=1"/> </noscript> <!-- End Facebook Pixel Code -->

Facebook Event Code Example

(Replace EVENTHERE with event type, e.g., Lead, Purchase, AddToCart)

<script> fbq('track', 'EVENTHERE'); </script>

Standard Facebook Events

Includes PageView, Lead, Purchase, AddToCart, InitiateCheckout, CompleteRegistration, and more.
See Facebook’s full list of standard events for reference.


Benefits

  • Gain deeper insights into user behavior and conversions

  • Optimize campaigns with accurate event tracking

  • Improve efficiency with better targeting and retargeting

  • Combine Pixel + Conversion API for maximum tracking reliability


FAQs

1. What is the Facebook Pixel?
A piece of code that tracks visitor behavior (page views, clicks, conversions) and sends that data to Facebook to improve ads and retargeting.

2. What is the Conversion API?
A server-side tool that sends event data directly to Facebook, ensuring more reliable tracking compared to the browser Pixel alone.

3. Can I use both Pixel and Conversion API?
Yes. Using both provides the most accurate and complete tracking setup.

4. Can I track multiple Pixels?
Yes. Add as many Pixel IDs as needed in the Events tab and manage them in the summary table.

5. What events can I track?
Page views, leads, purchases, checkouts, add-to-cart actions, and custom events.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article