wordpress basics cover

WordPress Basics: Add Facebook Pixel

By Ken Schnetz | October 16, 2017 | 0 Comments

Facebook Pixel Installation Guide

Welcome to the Facebook pixel installation guide. This guide is part of the VendorFuel WordPress Basics Series, which will seek to familiarize beginner-intermediate users with site, theme, and plugin development. Today, the topic is how to add a Facebook pixel to your WordPress site. This post will cover why Facebook pixels are important to your site, how to create a Facebook pixel, and how to install it onto your site.

How To Add A Facebook Pixel To Your WordPress Site

What Is A Facebook Pixel

facebook pixel analytics aThe Facebook Pixel is an analytics tool that captures user actions on your site. First, an admin generates the code snippet. Then, a developer embeds this code snippet in the website header. This code then tracks Facebook users that visit and interact with your site. Consequently, you can then use data gathered by the pixel in Facebook promotions and ads.

Why Use A Facebook Pixel

The data gathered by a pixel is incredibly useful in retargeting ads on Facebook. You can place ads in front of people that have visited your site, knowing that they have some interest in your business. This reduces ad spend while increasing the likelihood of converting prospects into paying customers. Using the Facebook pixel is an excellent way to get a second chance with potential customers!

Facebook Pixel Creation

On to the first step: creating the pixel. Of course, to complete this step you need to have access to the Facebook Ad Manager. Next, click on the menu button in the upper left side of the page. Expand to show all tools and select the Pixels option under Assets:

ads manager pixels a

Now, click the Add Data Source button to see a drop-down menu. Select the Facebook Pixel option:

ads manager pixels b

A window will appear with three options to install your pixel: third-party options such as Magento or Wix, Manual installation, or email the instructions to your developer. Assuming that you are the developer, select the manual option:

ads manager pixels c

At the top of this window, you will see some instructions. Below these instructions, you will see the code. Click this area to copy the code and you are ready to embed the pixel on your site:

ads manager pixels d

Embedding The Facebook Pixel

Now that you have the code snippet copied to your clipboard, you need to insert this into your site. First, on your WordPress admin panel, hover your mouse over Appearance and select Editor.

wordpress dashboard

After the page loads, you will see the code of the currently selected document in the center of the page. Adjacent to the code editor, on the right-hand side, you will see all the documents that make up the currently activated theme.

wordpress editor a

Next, select the file titled Them Header (header.php). Accordingly, the code editor will display the code contained within the header.php document. Now, paste the pixel code snippet directly above the closing head tag (</head>). Lastly, click the update button beneath the code editor to save the file.

wordpress editor a

To conclude, go back to the Facebook pixel editor and send test traffic to your pixel. Once completed, you will see that your pixel is active and tracking:

wordpress editor c

Retargeting Site Visitors

Now that the pixel is set up, give it a week or so to collect data. Once you have at least 100 visitors, it’s time to target them in an ad on Facebook. This ad should be a fairly subtle reminder that they were interested in your business or something to re-engage them. Before you boost a post or create an ad for this purpose, you need to create a custom audience based on the data gathered from the pixel. To do this, visit the Facebook Ad Manager, select All Tools, and then select Audiences under Assets:


Next, select Create Audience and then Custom Audience from the drop-down:

create audience

Then you will select Website Traffic:

website traffic

On the next window, you can create your audience. You can make any selection here that fits how your audience should be built. For example, you can retarget prospects that have visited specific pages. Or, you can retarget visitors by how much time they spend. You can even create custom parameters in your pixel that you can track. Once you have set the options and named the audience, select Create Audience:

audience creation

Now the magic happens… you can create an audience that matches people most like those who have already visited your site! Facebook is one of the greatest analytical powerhouses for knowing who is interested in what. You can tap into this powerhouse of data with lookalike audiences. In the window after you create your audience, you will see the following. Select Find new people similar to your existing users:

In the next screen, it is best to leave it as is until you get a larger audience of people that have already visited your page. Add a location and click Create Audience:

Now you have two new audiences that are extremely powerful. The first is your retargeting audience which will be fairly small depending on your website traffic and pixel parameters. Second, you have the lookalike audience which should be around 2 million people similar to those who have visited your site. You can now merge these audiences with other audiences, narrow down who in this audience should be targeted, exclude this audience, and so much more.


In summary, the Facebook pixel is an awesome way to retarget prospects that have visited your page! Moreover, the pixel is simple to create and install. in fact, this can be completed in just a few minutes. Consequently, in just a few days you should see traffic analysis on the pixels page of the Facebook Ads Manager. Use this data to create targeting ads and understand prospect behavior on your website.

If you use Chrome as your browser, you can install the Facebook Pixel Helper, which will show you information about pixels on any page you visit. Be sure and check out our Digital Marketing Quick Start guide for more information on how to launch a basic digital marketing campaign for ANY business.

Thank you for stopping by, please leave any comments or questions you have below and we will help you out. Also, don’t forget to share this post with your friends!

Opt in for future content!

We respect your email privacy.

Ken Schnetz

Blogging about business, marketing, and WordPress development, Ken Schnetz is the digital marketing and front end development team leader at VendorFuel.

No comments yet!

Write a Reply or Comment