A Beginner’s Guide to Adding Facebook Pixel to WordPress

While Facebook offers amazing advertising capabilities to publishers of all shapes and sizes, on the other hand, WordPress is considered to be the easiest, quickest and most efficient way of starting a business online. However, if you want to get the full value out of Facebook's advertising capabilities to boost up the growth of your WordPress-powered business, you’ll have to add the Facebook Pixel to your WordPress site. Let's know what the Facebook Pixel actually is and how to leverage it on a WordPress site.
Share on facebook
Share on twitter
Share on email
Share on facebook
Share on twitter
Share on email

If you’re advertising your WordPress-based online business on Facebook and want to get the most out of your advertising budget, there are two crucial things you must specialize in, one is reaching out the right audience and another is generating more conversions.

No matter what type of Facebook Ad you’re running, if you don’t know these two things well, you’re just whipping out your hard earned money on a whim and will never get expected results.

While Facebook offers amazing advertising capabilities to publishers of all shapes and sizes, on the other hand, WordPress is considered to be the easiest, quickest and most efficient way of starting a business online.

However, if you want to get the full value out of Facebook’s advertising capabilities to boost up the growth of your WordPress-powered business, you’ll have to add the Facebook Pixel to your WordPress site. Let’s know what the Facebook Pixel actually is and how to leverage it on a WordPress site.

What is the Facebook Pixel and Why Should You Use It?

The Facebook Pixel is nothing but essentially a piece of JavaScript code that empowers you to measure the effectiveness and profitability of your Facebook ad campaigns by helping you understand the actions visitors take on your website and accordingly reach the audience you otherwise might not be able to get to. When you install the Facebook Pixel on your blog or website, you’re able to:

View Your Website’s Traffic

With powerful Facebook Pixel dashboard, you can track all of the traffic to your website, get rich insights about how visitors are interacting with your website and create custom audiences to see how your Facebook Ads are performing.

Track Conversions

Enabling you to monitor what actions users take on your website after clicking your Facebook Ad, the Facebook Pixel allows you to measure conversion rates of your Facebook Ads. You can even track your customers across different devices before they convert.

Optimize Your Facebook Ad Campaigns

With the help of the data collected by the Facebook Pixel tracking, you can refine your Facebook advertising strategy to improve your Return on Advertising Spend (ROAS) and optimize your ad spend for better conversions. The Facebook Pixel ensures that your ads will be shown only to the users who are most likely to take your desired action, like making a purchase.

Retarget Your Website Visitors

Using the Facebook Pixel tracking data, you can also serve relevant ads to people who have already expressed their interest in your products or services. For instance, you can show users an ad for the same item which they viewed but didn’t buy on your website. Needless to say, Facebook dynamic ads are built to fulfill the same purpose.

Reach the Right People

In addition to helping you target your existing and most engaged customers, the Facebook Pixel also expands your potential customer base by helping you find new customers on Facebook. You can use its tracking data create lookalike audiences of people having similar likes and interests to your best existing customers.

In a nutshell, Facebook Pixel is an Analytics for your Facebook Ad campaigns which provides you a lot of metrics and data related to people visiting your website through Facebook ads so that you can better target them to maximize conversions and drive more sales.

How Does the Facebook Pixel Work?

The principle behind the working of the Facebook Pixel is very similar to how Google Analytics works. The Facebook Pixel is actually an invisible, 1×1, unique image file that you embed into your website with the help of the JavaScript code provided by the Facebook.

Whenever someone visits your website and takes a specific action, Facebook leveraging the power of an HTTP cookie instructs the browser to download that invisible image from Facebook servers to user’s device that is being used to access the website.

Of course, Facebook can easily track exactly how many times the invisible image has been downloaded, when, and by whom. Facebook can even track what browser, machine, operating system and IP address was used to download the transparent image. Combining all these details, Facebook generates an overall digital signature of all the technologies used by the visitor.

When the user logs into his Facebook account using the same browser, Facebook maps the downloaded image to the specific Facebook ID. Thus, on the basis of a specific user’s browsing behavior, the Facebook Pixel allows you to serve targeted ads. This is called conversion optimization.

How to Add the Facebook Pixel to WordPress?

There are fundamentally three ways to install Facebook Pixel on a WordPress site. Let’s explore each, one by one.

Using the Official Facebook Pixel plug-in

The first and foremost step to install the Facebook Pixel on your WordPress site is generating the Facebook pixel base code. Log in to your Facebook account and head over to the Ads Manager. Click the hamburger menu given in the upper left corner and then click Pixels tab under Events Manager.

WordPress Facebook Pixel Image1

You’ll then see a page like this:

WordPress Facebook Pixel Image2

Click ‘Create a Pixel’ button shown in the above snapshot, enter your Pixel name and click Create. After getting a success message, you’ll be then shown a pop-up saying ‘Install Your Pixel Code’.

WordPress Facebook Pixel Image3

As you can see, here you’re given three options. Select the first one ‘Use an Integration or Tag Manager’ and you’ll be asked to choose a partner.

WordPress Facebook Pixel Image4

Choose WordPress and click the Download link to download the Facebook Pixel plug-in.

WordPress Facebook Pixel Image5

Once the Facebook Pixel plug-in is downloaded, you’ll need to upload and activate the plugin via your WordPress dashboard. Sign in to the WordPress and click ‘Add New’ under ‘Plugins’ tab in your WordPress admin panel.

WordPress Facebook Pixel Image6

Click ‘Choose File’ and upload the downloaded Facebook Pixel plug-in. Then click ‘Install Now’ and finish the set up by clicking ‘Activate Plugin’ button.

WordPress Facebook Pixel Image7

Now, after at least 30 minutes, go to Ads Manager and click the Pixels tab from the top menu. If the status is Active, your Facebook Pixel has been installed correctly.

WordPress Facebook Pixel Image8

Manual Installation

The above method, however, works only with websites using WordPress v4.4 and above. What if your WordPress site is running on a version lower than 4.4? In that case, you have to opt for the manual setup route. Wondering how? Just follow the instructions given below:

When you’re prompt to pick an option to install the Facebook pixel code, choose ‘Manually Install the Code Yourself’ instead of using an Integration or Tag Manager.

WordPress Facebook Pixel Image9

Here you’ll be shown where you need to put the code on your website. Simply click on the code provided in step 2 and it will be copied to your clipboard.

WordPress Facebook Pixel Image10

From the same pop-up, you can also send test traffic to your Facebook pixel to check its status – but only after installing the code on your WordPress site.

WordPress Facebook Pixel Image11

Unlike the first method, which automatically tracks what actions people are taking on your website, the manual installation provides you an option to toggle on and off events. Click ‘Continue’ button shown in the above image and you’ll be presented with a new pop up to select the events you’d like to track.

WordPress Facebook Pixel Image12

However, you must install the pixel base code first to make your preferred event categories work.

Now go to your WordPress Dashboard -> Appearance -> Editor and you’re your theme’s header.php file. Look for the < /head> tag, paste the copied Facebook Pixel code just before it. Update the file and you are done.

WordPress Facebook Pixel Image13

In case you’re too lazy to open the header.php file, simply use the Head, Footer and Post Injections plug-in for the same.

Using the Google Tag Manager

Additionally, if you’re already using Google Tag Manager on your WordPress site, installing Facebook Pixel through Tag Manager would also be a wise option. From the options given to install the Facebook pixel code, choose the first one ‘Use an Integration or Tag Manager’ and choose Google Tag Manager as your partner.

WordPress Facebook Pixel Image14

You’ll be then given two options, quick install by simply logging into your Google Account and manual installation by inserting pixel code snippets into your website’s code. Since the first method is quite easy, here we’ll discuss the second option: manual installation.

WordPress Facebook Pixel Image15

Click ‘Manual Installation’ and copy your pixel base code from the step 1.2 given on the next screen.

WordPress Facebook Pixel Image16

Now login to Google Tag Manager account, select your website’s container and create a new tag.

WordPress Facebook Pixel Image17

Then paste your pixel base code in the HTML field under Configure Tag.

WordPress Facebook Pixel Image18

After that, expand the Advanced Settings section and select ‘Once per page’ under Tag firing options.

WordPress Facebook Pixel Image19

Click ‘Continue’, select ‘All Pages’ under ‘Fire On’ and click ‘Create Tag’ to finish the setup.

WordPress Facebook Pixel Image20

Like the manual installation, this method also allows you to manually create action-specific tags for the different types of pages and actions taken on your WordPress site. You can do it in the same way you have installed Facebook Pixel using the Google Tag Manager, with a few minor tweaks in tag settings as shown in the image below:

WordPress Facebook Pixel Image21

Likewise, you can create action-specific tags for the other events (like add to cart, purchase, etc) on your WordPress site.

WordPress Facebook Pixel Image22

That’s all about adding the Facebook Pixel code to a WordPress-powered site. In case, your pixel isn’t working properly and reporting ‘No Activity Yet’ instead of ‘Active’, install the Facebook Pixel Helper Chrome extension to get more information and troubleshoot the actual problem.

Check out these cool Facebook plugins from CodeCanyon

Table of Contents
Our Sponsors
Our sponsors

4 Responses

  1. Hello Ashish
    I Want To ask what if i want to install more then one pixel through facebook partner integrations is that work in my wordpress site?

Leave a Reply

Your email address will not be published. Required fields are marked *

Stay up-to-date with the Mayor
Sign up to receive one weekly email about our latest reviews, tutorials, giveaways and more.