How to Add the Facebook Pixel in WordPress

Facebook Pixel WordPress

Facebook advertising, in our opinion, is the best PPC channel out there. In fact, no other PPC channel at Zen WP has a conversion rate higher than Facebook’s. We get anywhere between 30-40% of our new customers every year as a direct result of Facebook ads.

And as with any PPC channel, you’re probably already sold on the idea of retargeting or remarketing advertising. But in order to create a retargeting audience on Facebook for Business, you have to start off by installing a pixel (that Facebook provides you) on select pages of your website.

Now before I show you our step-by-step how to install the Facebook Pixel, let’s start off with some basics first:

Don’t Add the Pixel to Every Page

Most people, when they first hear the words “tracking pixel,” their natural assumption is to install the pixel on every page of their website like they do with Google Analytics.

Have you added the Google Analytics code to your website correctly?

You should not install the Facebook Pixel on every page of your website.


Your goal with other tools like Google Analytics is to track everyone that visits your website.

However, with Facebook retargeting, your goal is to remarket to those who have already visited your website and took specified actions, but did not convert at the end of the visit.

The two goals are completely different.

So why wouldn’t you want to remarket to every single person that visits your website?

Let’s use an example.

Say you own a private school and have a website for the school. Chances are that your website is indexed by Google. This means every page and every single image on your site and its image link will show up on Google search results. This includes search results that may have nothing to do with your business.

Now let’s say that one of the images on your website is a class photo in front of a tree. That image is probably indexed by Google and will show up on Google Images search results for search terms as basic as “tree.”

And if you installed the Facebook Pixel on every page of your website, the people who clicked on that image through Google will be included in your remarketing audience for your Facebook ad campaigns.

See how this would be a problem?

Let’s say you were running a school enrollment campaign for your website and created a remarketing audience targeting website visitors. You would be wasting a lot of money because a larger than normal portion of your remarketing audience will be made up by people who don’t ever recall interacting with your brand.

Adding the Facebook Pixel to Your WordPress Website

So how would you add the Facebook Pixel to select pages on your WordPress website?

Well, it will certainly take a lot of work to do it manually and it would be too advanced of a task for most WordPress users.

Fortunately, however, there are some great plugins that could help you achieve this. Our two favorite plugins are Facebook Conversion Pixel and Facebook Pixel by PixelYourSite.

Each of the two has features that we wish the other had, so choosing one for yourself will really be a matter of what’s more important to you. Here’s a brief review of both plugins.

Facebook Conversion Pixel

This plugin is actually recommended by Facebook itself on their Help page. The reason why it’s so popular is because this plugin will show a box on every Edit Page and Edit Post page, allowing you to select whether you want the pixel on that page or not.

The only drawback of this plugin is that it isn’t fully compatible with a noticeable number of WordPress configurations. We at Zen WP continue to have several instances where this plugin wasn’t usable and broke our users’ sites. And unfortunately, we don’t expect this to improve because the plugin is completely free, which means support for it is weak.

Facebook Pixel by PixelYourSite

Facebook Pixel by PixelYourSite is the plugin that Zen WP’s website uses to implement its Facebook Pixel. Although it doesn’t allow you to choose whether you want to add the pixel at the individual page level, you can still choose to implement it on every page, post, image file, and so forth.

But the real reason why we use this plugin ourselves and recommend it is because there is active support for it. There is a paid version of the plugin so you know that the plugin authors are always keeping the software/plugin up to date, both the free and paid versions. In fact, we’ve yet to receive a report of this plugin causing major issues with a WordPress site.

Speaking of the paid version, if you’re running a very large retargeting campaign on Facebook, you might find Facebook Pixel’s paid version very useful. The paid version comes with advanced tracking features that are especially valuable for eCommerce sites.


If you are using either plugin, it will ask you to copy and paste your Pixel ID and not the entire snippet of code that Facebook provides you.

In order to find the Pixel ID, view your code and you’ll see a 15-digit number in blue font within the code. This is your Pixel ID.

Alternatively, if your Facebook Pixel has already fired at least once, you can view your Pixel ID by going to your Pixel page. The Pixel ID will be clearly shown on the right sidebar.

Should You Delay Firing the Pixel?

In both plugins mentioned earlier, you’ll have the option of delaying (in seconds) when the pixel fires and consequently add that user to your retargeting audience.

You should absolutely consider adding a delay in an effort to exclude bouncing users. In fact, the longer the delay, the better, since only the most engaged users will be added to your retargeting audience and when you go back to use the Lookalike Audience feature on Facebook for your retargeting campaign, you’ll see improved accuracy.

However, how long you should delay it is a question you’ll have to answer for yourself. It will depend on the type of website you have, how users interact with your website, and the length of the content.

Keep in mind that since all elements of the page don’t load instantaneously, you should set a delay time that’s a little bit lower than what you actually want it to be.

Verify the Pixel is Working

After you have successfully installed the pixel, you’ll have to make sure it’s working properly.

1. First, download and open the Google Chrome browser.

2. Download and install the Facebook Pixel Helper from the Chrome Web Store.

3. Follow the instructions to activate the App on your Chrome browser.

4. Restart the browser and enter the URL for a page on your website where the Facebook Pixel will be present.

5. You should see the Facebook Pixel Helper icon on the top right-hand corner of your browser window.

Facebook Pixel icon

6. Click on it to view the information. You’ll know it’s working if it shows that the Facebook Pixel has been detected on the current page.

Facebook Pixel verification

Sign Up for New Content