• Categories
    • Tutorials
    • Beginners Guide
    • WordPress News
    • WordPress Security
    • Best WordPress Plugins
    • WordPress Themes
    • Product Reviews
    • WP Tips & Tricks
  • Guides
    • Start a Blog
    • Make a Website
    • WordPress Hosting
  • WordPress Hosting
    • A2 Hosting
    • HostGator
    • Bluehost
    • Cloudways
  • Managed Hosting
    • WPEngine
    • Rocket.net
    • WPX
    • Kinsta
  • Coupons
    • WPEngine
    • Flywheel
    • Cloudways
    • A2 Hosting
    • WPX Hosting
WordPress Tutorials

How to Install Facebook Remarketing/Retargeting Pixel in WordPress

Last Updated on: September 19, 2020 Randy 3 Comments

How to Install Facebook Remarketing/Retargeting Pixel in WordPress

Have you ever been to a website and later you start seeing their ads on Facebook? If so then you’ve probably wondered how this happens and what the advantage of it is. The website is using an easy to use tool built into Facebook Ads Manager called Facebook Pixel to perform a type of marketing known as retargeting.

Retargeting, also known as remarketing, allows you to show your ads to people that you know are already interesting in your website. Using Facebook Pixel you can retarget your ads to your website’s previous visitors.

In order to use Facebook Pixel you’ll need to install some code on your website. This code tells Facebook that someone visited this page, allowing Facebook to track your traffic which in turn allows you to target your website’s audience on Facebook.

In this article we’ll take a look at how to install this code on your WordPress website.

Step 1. Getting the Facebook Pixel Code

Getting the Facebook Pixel Code

Facebook Pixel is part of Facebook’s advertising platform. Everyone with a Facebook account had access to this platform. To get it login to Facebook and select the Ads Manager. This will either be on the right under Favorites or in the down arrow drop-down menu under Manage Ads. In the Facebook Ads Manager select Tools and then Pixels. Next, click on the button that says Create a Pixel. This will give you the code you need to place into the header of your website.

It will ask you to choose a name for your Pixel. You can only have one Pixel per ad account. Facebook recommends that you choose a name to match your business. Name your Pixel, agree to the terms, and click Create Pixel. Your Pixel is now ready to install. You have the option to use the code yourself or email it to someone such as a developer to implement it for you. Select Install Pixel Now.

view pixel code

Copy the JavaScript code to place it on your website. I recommend pasting it into a text editor and saving it so you’ll have it handy. You can also use this code with plugins on individual pages and posts with plugins such as Facebook Conversion Pixel. Next click Set Up Events and then click Done.

Step 2. Installing the Code Manually

You can install the code manually or you can add it to a plugin that controls your headers. To install the code manually go to your WordPress Dashboard and select Appearance and then Editor. On the right side on the screen select Theme Header.

Installing the Code Manually

Look for the tag </head> and paste the code just before it. You might need to add a few lines to make room. Once you’ve pasted your code click Update File and that’s it. Your code will now run on your website.

Note – if you change themes you’ll have to add the code to the new theme. An alternate method would be to use a plugin to handle your headers such as Header and Footer. Simply place the code into your header scripts and the code will be placed into your header for you. Now if you change themes you won’t have to worry about adding the code to your new header file.

In order to improve tracking you might prefer to use the code on specific posts or pages rather than your entire website. Facebook has code snippets that you can use to track individual pages and events but they’re not WordPress friendly. A better option would be to place the code on pages and posts using a plugin.

Step 3. Facebook Conversion Pixel Plugin

Facebook Conversion Pixel Plugin

If you only want to place the code on specific pages, posts, and custom post types you can use a plugin such as Facebook Conversion Pixel. With this plugin you can enable the plugin to work with various posts, pages, and post types including WooCommerce and others. For example you can enable the Product post type and place the code on your checkout page for easy tracking.

Facebook Conversion Pixel code

Once you’ve installed it and enabled the post types you want to use it with go to the page or post with that post type. A box will now appear where you can place the code. Click the button to allow the code to work and then paste the code into the box. When you publish or update the page the code will run.

The advantage of placing the code on specific posts is you know the visitors have seen your offer already.

Step 4. Using Facebook Pixel with Multiple Websites

You’re only given one Pixel per ad account. That’s not a problem if you only use Pixel for one website, but what if you want to use it for multiple websites? You can do one of two things:

  1. Have more than one ad account. This might work, but you’ll have to deal with multiple logins, multiple stats tracking, and payments can be bothersome. This is ideal if you have a team and you’ve assigned a different team member to each account.
  2. Use the same Pixel on all of your domains and set rules to distinguish between them. This is done by creating Custom Audiences.

Custom Audiences

Custom Audiences

To create a custom audience go to Facebook Pixel in the Ads Manager and select Create Audience. In the Website Traffic dropdown box choose People who visit specific web pages. This will show you another box where you can add URL keywords. Place your domain name here. In the box for Audience Name type a name for that specific audience.

This is a good idea even if you’re only using the code on one website. You can track for specific offers from your website and then show a different ad based on the offer they saw on your website.

Conversion Tracking

Although Facebook Pixel tracks website visits rather than conversions, there is a way to track conversions across multiple domains. To do this you’ll need to create a Custom Conversion for each domain. Keep in mind though, you’re only allowed 20 custom conversions.

Conversion Tracking

In the Facebook Pixel Manager select Create Conversion. In the next window select Track Custom Conversions.

Conversion Tracking 2

Type in the URL and select the category you want and hit Next.

Conversion Tracking 3

Give it a name and set the conversion value if you want and then hit Create. Once you’ve collected enough data you can target your ads based on the conversions.

Step 5. Analyzing your Stats

Analyzing your Stats

The Pixel allows you to view website traffic, track conversion and optimization, and remarket. You can see traffic by events, URL’s, domains, and devices. You can the information to create ads, audiences, conversions, and actions.

Final Thoughts

Facebook is an excellent platform for building your brand and targeting your audience. You can boost your Facebook posts using ads, but rather than targeting a wide audience you can use retargeting to narrow the audience for better results at less money.

Not only is Facebook Pixels a great tool for getting the most out of your Facebook ads, it’s also free and easy to use. Even if you don’t use Facebook ads now, you can use the stats and tracking to help you use it later.

We’d like to hear from you! Do you use Facebook Pixel with WordPress? Do you have anything to add? Let us know in the comments below.

+ Share
Disclosure

Randy

Related Posts

Back to all articles
  • Dealing with WordPress RSS Feed Errors: How to Identify and Fix Them

    Dealing with WordPress RSS Feed Errors: How to Identify and Fix Them

  • What is WordPress? A Beginner's Guide!

    What is WordPress? What Can it do & Is it Right for You? A Beginner’s Guide

  • How to Set Up WordPress Two-Factor Authentication: WP 2FA Review

    How to Set Up WordPress Two-Factor Authentication: WP 2FA Review

Coupons

View more deals
  • WP 2FA Coupon
    20% OFF

    WP 2FA Coupon

    Security should be at the forefront of all site owner’s min
    Get This Deal
  • 10% OFF

    Elegant Themes Coupon

    You can’t move within WordPress circles without coming across E
    Get This Deal
  • ChurchThemes.com Coupon
    20% OFF

    ChurchThemes.com Coupon

    No church can survive without a congregation. In addition, a mode
    Get This Deal
3 Comments Leave a Reply
  1. Kalpana Sharma says

    April 5, 2016 at 2:29 am

    This is really an awesome and very informative article. This is really and amazing way for marketing. This is something I was aware of, but I was not sure how to do this. But with this detailed article I now know how to do this. I will definitely try this for my blog and e-commerce site.

    Thank you for sharing such in-depth article with us. This is really so helpful.

    Reply
    • Devesh Sharma says

      April 14, 2016 at 4:06 pm

      Glad you found the article informative. Thanks for stopping by.

      Reply
  2. James Hipkin says

    April 14, 2016 at 8:40 pm

    Love this.

    We built a plugin that we used on the custom WordPress sites we build. It was so useful for our customers that we released it a year or so ago. Tracking Scripts Manager (https://wordpress.org/plugins/tracking-script-manager/) can be used for this and much more. It lets you add any tracking script including the Facebook Remarketing/Retargeting pixel to the header, footer, pages and posts.

    James

    Reply

Leave a Reply Cancel reply

Full Disclosure This post may contain affiliate links, meaning that if you click on one of the links and purchase an item, we may receive a commission (at no additional cost to you). All opinions are our own and we do not accept payments for positive reviews.

Our Newsletter

Get awesome content delivered straight to your inbox.

Thank you!

You have successfully joined our subscriber list.

.

THE BEST OF WPKUBE

Some of the best content we have published so far.

BEGINNER GUIDES & REVIEWS

110 Best WordPress Hosting Options for 2025 (Pros & Cons)
28 Best Managed WordPress Hosting Providers for 2025 Compared
38 Best Cheap WordPress Hosting Providers in 2025 (From $1.99)
46 Best WordPress LMS Plugins – Detailed Comparison & Review for 2024
55 Best WooCommerce Hosting Providers Compared in 2025 (All Budgets)
66 Best WordPress Landing Page Plugins Compared + Recommendations (2024)
79 Best List Building Plugins for WordPress In 2024
8How to Fix the 500 Internal Server Error on Your WordPress Website
9Beaver Builder Review: Honest Thoughts + Pros and Cons (2025)
10OptimizePress Review: Create Landing Pages with Ease
11How to Make a Website: Complete Beginner’s Guide
12Top 22 Best Free Stock Photo Resources For Your Site
13How to Start a Blog in 2022 (Step by Step Guide)
14How To Fix ‘503 Service Unavailable’ WordPress Error
1511 Best Contact Form Plugins for WordPress in 2025
16How to Add a Custom Logo to Your WordPress Site
17How to Fix Error Establishing a Database Connection in WordPress

WPEngine: 50% OFF Deal

Save 50% on one of the best managed hosting providers.

Get this Deal
Featured In Forbes Huffpost Entrepreneur SEJ

About WPKube

WPKube is an online WordPress resource which focuses on WordPress tutorials, How-to’s, guides, plugins, news, and more. We aim to provide the most comprehensive beginner’s guides to anything about WordPress — from installing plugins, themes, automated installs and setups, to creating and setting up pages for your website.

We have over 500+ tutorials, guides, product reviews, tips, and tricks about WordPress. Founded by Devesh Sharma, the main goal of this site is to provide useful information on anything and everything WordPress.

Twitter Facebook

Useful Links

  • Behind the Scenes
  • Beginner Guides
  • WordPress Hosting
  • WooCommerce Themes
  • MeridianThemes
  • Exclusive WordPress Deals
View All Guides »

Reviews

  • WPEngine 33% OFF
  • WPX Hosting
  • Flywheel 33% OFF
  • Divi Theme 20% OFF
  • Systeme.io
  • Elegant Themes
Reviews »

Deals

  • InMotion Hosting
  • LifterLMS Coupon
  • LiquidWeb Coupon
  • WPEngine Coupon
  • A2 Hosting
  • Solid Affiliate
More Deals »
© Copyright 2023 WPKube ® All Rights Reserved.
  • Contact
  • Site Terms
  • Disclosure
  • Privacy Policy