Javascript required
Skip to content Skip to sidebar Skip to footer

How to Install a Facebook Pixel on Wordpress

If you are running Facebook ads, you know how important it is to track conversions with a pixel. It's why we made a list of 3 simple ways to add your Facebook pixel to WordPress.

Why is the pixel important? The pixel allows you to better optimize your ad campaigns by allowing you to know which ads converted into sales.

How does the pixel work? You essentially need to add a piece of code to every page that has a meaning. For example, you could add a pixel code in your purchase confirmation page which would tell Facebook you just go a purchase.

In order to help you out, I will show you three methods to install your pixel in a smooth, easy & fast way:

1. Installing it manually – this is the most efficient way to do it, but can be more complicated depending on your theme.

2. Using the Pixel Caffeine plugin – using this plugin is a great option because it enables you to create custom conversions & goals, and it integrates with WooCommerce & Easy Digital Downloads.

3. Using the PixelHelper plugin – using this plugin is a great option because you can connect your Google Analytics & Facebook pixel. You can also create events directly from your WordPress dashboard.

I recommend using a plugin if you want to create custom conversions & goals, but some people don't like having too many plugins. In this case, you should enter the code manually.

How to add Facebook Pixel to WordPress manually

To add the Facebook pixel to WordPress manually, you need to do it in two steps.

  • The first step requires that you create your Facebook pixel in the business manager if you haven't done it.
  • The second step requires that you insert the pixel in the <head> section of every page of your website you want to track.

Step 1 – Facebook Pixel Creation

First, go in the events manager in data sources. This is what should you see.

Facebook Business Manager

Then, click on "Get started" in the Facebook pixel section.

Install Facebook Pixel

At this stage, choose the name of your pixel and your website URL. After that, just click continue.

Install Facebook Pixel

At this stage, select "manually add pixel code to website".

Install Facebook Pixel
Install Facebook Pixel

At this stage, you need to copy the code and click "turn on automatic advanced matching". Don't close this page just yet, because we need to do the next step before.

Step 2 – Installing the pixel in the <head> section

There are a lot of ways to add a code to your headers and footers, but I believe the easiest way to add it is through a free plugin called "Insert Headers & Footers".

Insert Headers & Footers

Here's how to do it once you activated:

  • Go to Settings → Insert Headers and Footers
  • Paste the Facebook Pixel tracking code into the Scripts in the Header box
  • Save your changes

Copy and paste the code from the previous step in there and then go back to the business to test the base code.

Now, let's dive into adding your pixel to WordPress with PixelYourSite & PixelCaffeine.

How to add Facebook Pixel to WordPress With PixelYourSite

The process isn't very different from the first one. You need first to go create your pixel exactly like in step 1 above and then I'll show you how to add that pixel to the PixelYourSite plugin.

What's good about PixelYourSite? You can insert your Facebook pixel, Google ads tag, google analytics, Pinterest tag & Bing tag. Here's how to do it.

First, activate and install the plugin PixelYourSite.

PixelYourSite

After that, you'll need to go in the dashboards plugin and insert your pixel code which you can find under "pixel" or "events manager" in your business manager after you've created it in step one.

Pixel Business Manager Facebook

Copy that code into the dashboard of PixelYourSite's dashboard under Facebook ID like in the picture below.

Facebook PixelYourSite WordPress

And that's it, you've entered your Facebook pixel. You can get the pro version if you wish to have multiple pixels on your website.

How to add a Facebook pixel to WordPress With PixelCaffeine

Installing this plugin is pretty similar to installing to PixelYourSite. The advantage of PixelCaffeine is that all the features are free.

First, you need to install & activate PixelCaffeine.

PixelCaffeine WordPress

After you've activated the plugin, go inside and go to settings.

PixelCaffeine Settings

Then, you need to click on Facebook connect and accept PixelCaffeine's access to your Facebook ads business manager.

After that, you'll be prompt to select the ad account and the right pixel ID related to the account.

If you want to fully leverage PixelCaffeine, you should look into the tabs "custom audiences" and "conversions/events".

PixelCaffeine

How to test if your pixel is working?

To test your pixel we recommend using the chrome extension "Facebook Pixel Helper" which will allow you to know if there's a pixel installed on your webpage. This is what you should see:

Facebook Pixel Helper

You'll be able to see the pixel ID and make sure it's the same that appears in your pixel page in your business manager.

Make sure that if you have an ad blocker, you are allowing it for your website, otherwise, the pixel will not appear even though it's there.

How to Install a Facebook Pixel on Wordpress

Source: https://www.k6agency.com/facebook-pixel-to-wordpress/