How to Add a Facebook Pixel to WordPress (Easiest Way)

Looking for a tutorial on how to add a Facebook Pixel to WordPress?

Using a Meta pixel is necessary when you’re running Meta (Facebook) ads. With a pixel, you can track conversions to make sure your ads are working, and you can track pageviews in order to set up retargeting ads and audiences.

If you’re using WordPress, there’s one really simple way that you can install your Meta Pixel and track conversions from your ads. That’s what we’re going to show you how to do in this article.

Table of Contents

  1. What is a Meta (Facebook) Pixel?
  2. Video Walkthrough
  3. How to Create a Meta (Facebook) Pixel
  4. How to Add a Facebook Pixel to WordPress
  5. Meta (Facebook) Pixel + WordPress FAQ

What is a Meta (Facebook) Pixel?

A Meta (Facebook) pixel is a snippet of code that you can install on your site if you’re running Facebook ads. When you add that snippet of code to your site, you’re giving Facebook access to track your website visitors, their clicks, and their conversions.

MonsterInsights is the best WordPress Analytics plugin. Get it for free!
How to Add a Facebook Pixel to WordPress

This makes it possible for Facebook to give you information about how your ads are performing, which helps you improve them.

It can also capture your visitors and categorize them into different audiences so that you can use retargeting ads to laser target them.

It’s a very similar idea to Google Analytics.

Meta Pixel Video Walkthrough

How to Create a Meta (Facebook) Pixel

If you haven’t created a Facebook pixel yet, you can do it in just a couple of clicks! Already have a pixel created? Jump to our tutorial on how to add your pixel to WordPress.

Step 1: In Events Manager, Connect Data Sources

To create a Facebook pixel, head to the Facebook Events Manager and, in the side navigation, choose Connect Data Sources:

Connect Data Sources - FB Event Manager

Step 2: Create Your Pixel

Now, go ahead and click Web, then the blue Connect button:

Then, name your pixel whatever you’d like and click the Create Pixel button:

In the next step, you’ll be asked to input your website’s URL. Go ahead and do that and click Check:

Step 3: Choose Install Options

Now, the tool will walk you through install options. We actually won’t need the code when installing with MonsterInsights, but we’ll go through this part anyway.

Choose Meta Pixel only, then click Next:

Finally, choose the Install code manually button. This will show you the base code that you’ll need to install if you choose, but when installing with MonsterInsights, we won’t need it.

Install Meta/Facebook Pixel code manually

That’s it, your pixel is created! Let’s install it on your website.

Add a Facebook Pixel to WordPress: Easiest Way

The hands-down easiest way to add your Facebook pixel to WordPress is with MonsterInsights.

MonsterInsights Logo

MonsterInsights is the best Google Analytics plugin for WordPress, and with its PPC Ad Tracking addon, you can install your Meta (Facebook) Pixel and track conversions from your ads in just a couple clicks.

With the addon, you can track Meta ad conversions on your WooCommerce, Easy Digital Downloads, LifterLMS, MemberPress, or GiveWP site. Or, use the addon on any other type of website to track page views.

Plus, you’ll get access to tons of other Google Analytics features, such as:

To access the PPC Ad Tracking addon, you’ll need MonsterInsights Pro. Get started now!

For a full walkthrough of how to set up MonsterInsights, check out our guide on How to Add Google Analytics to WordPress the Right Way.

Once you have the plugin set up, you can continue on in our Facebook Pixel installation tutorial.

Step 1: Install the Ad Tracking Addon

First, we need to install the MonsterInsights Ad Tracking addon. To do that, head to Insights » Addons and scroll down to PPC Tracking. Click Install:

Install PPC Ad Tracking Addon

The addon will activate automatically after installation.

Step 2: Copy Your Pixel ID

To add your Facebook pixel to WordPress, all you’ll need is your pixel ID. To find it, head back to the Events Manager and it’ll be on the right-hand side:

Copy pixel ID

Go ahead and copy it. We’ll use it in a moment.

Step 3: Paste Your Facebook Pixel ID in WordPress

To add your Facebook pixel to WordPress, all you have to do is navigate to Insights » Settings » Conversions:

Conversions Tab in MonsterInsights

Then, scroll down to the Ads Tracking box and paste your ID into the Pixel ID field:

PPC Ads Tracking - Meta

That’s it! You don’t have to install any other code for your pixel to begin tracking conversions and pageviews.

How to See Facebook Traffic in WordPress

With MonsterInsights, you’ll be able to see your Facebook traffic right inside your WordPress dashboard. See at a glance if your visitors from Facebook are engaged and/or completing conversions on your site.

Just head to Insights » Reports » Traffic » Social media:

MonsterInsights Social Media Report

For more on connecting Facebook to WordPress, check out How to Connect Google Analytics to Facebook (Easiest Way).

Meta (Facebook) Pixel + WordPress FAQ

How do I add a Facebook pixel to my WordPress site?

To add a Facebook pixel to your WordPress site, install MonsterInsights Pro. Then, head to Insights » Settings » Conversions and paste your pixel into the Pixel ID box.

How do I manually add a Facebook pixel to my website?

To manually add your pixel, copy and paste the code from Facebook Events Manager into the header.php file of your website, just above the closing </head> tag.

Remember, this file is overwritten any time you update your theme. To easily manage your code snippets without losing them every time you update your theme, try a plugin like WPCode.

How do I add a Facebook page to my WordPress site?

If you want to add your Facebook feed to your WordPress site, grab the Smash Balloon Social Post Feed plugin to add your Facebook page to your WordPress site for free.

If you liked this article, you’ll probably also want to check out:
How to Connect Google Analytics to Facebook (Easiest Way)
9 Facebook Ad Targeting Tips to Skyrocket Your Conversions
How to Track Meta (Facebook) Ads in Google Analytics Easily

Not using MonsterInsights yet? What are you waiting for?

And don’t forget to follow us on Twitter, Facebook and YouTube for more helpful reviews, tutorials, and Google Analytics tips.

Want to Try MonsterInsights for Free?

Enter the URL of Your WordPress website to install MonsterInsights Lite.

Comments

  1. Lovely to see you adding this to MonsterInsights Pro and saving me adding yet another snippet… Any idea when this will be live? Not showing on my v8.14.0 installation on WP 6.2 yet.

    1. Hey Tim! Thanks, we’re pretty stoked about it too! It’s out and ready to rock. The trick to getting it to appear is making sure you have the old Ads addon deactivated, and the new one activated instead. In the future, the old Ads addon will be deprecated to avoid the confusion.

  2. Does this use conversions API? If not then the data will not be accurate if a user blocks ads. FB has their own plugin and there are other that use the conversion API. Prefer not to use another plugin for this.

    1. Hi Bruno – We do not use the conversions API at this time but it’s been added as a feature request.

    1. Hey Byron – Not yet, but it’s a highly requested feature! I’ll add your vote. We’ll keep your email address and you’ll be alerted if we add it.

      1. Is this being worked on for release anytime soon? Does its “highly requested feature” move it to production?
        Do not want to add a Facebook plugin just to overcome problem.

        1. Hi Richard,
          You’re in luck – I can go ahead and share that we are working getting the Meta Conversion API ready to go for our users. Unfortunately I can’t give you a specific timeline for its release, but it is being worked on now!

          1. Excellent support. On behalf of us all, many thanks for your positive and proactive development work.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.