Setting Up a Facebook Tracking Pixel for Retargeting: Step by Step

Facebook Custom Audiences

Table of Contents

A while back Facebook partnered up with three of the biggest data collection companies in the US.  On top of knowing about all your likes and what’s going on in your life, they now have access to other information about you – the size of your family, things you buy, where you shop, what kind of car you drive, etc.

Like it or not, they know a lot.

While that may sound spooky, there is a good side to this news, too.  As a business owner, they’re letting you use that data to find new customers.

And if you EVER think there’s even a 1% chance that someday you might want to advertise on Facebook, stop what you’re doing and follow these instructions immediately.

It’s that important.

You see, once you start putting out great content, you’re going to want more people to see it.  And while Google AdWords has always been the defacto way to get more traffic, they’re limited by the keywords people are putting into Google’s search engine.  With Facebook, you can now put those same ads in front of people using the data they have – making your ads perform much better and cost less per conversion.

Cheaper customer acquisition? Who doesn’t want that?

On top of this great news, they have now also given us something really cool called Website Custom Audiences.

By simply adding a tiny snippet of code to your website, you can now have Facebook track those visitors and the show your relevant ads to them.

This is called ‘retargeting’ and you’ve probably been the victim of it more than once.

What is Retargeting?

Retargeting, as the moniker says, is targeting people that have already visited your website and showing them relevant ads.

Have you ever shopped for a product on Amazon, but didn’t purchase it?  Then, for the next few days, ads for that product showed up around the web as you were surfing?  That’s retargeting.

And lots of businesses are doing it.  Why? Because it works.

Think about it – if someone visits a piece of content you wrote, they’re probably interested in what you write about in general, and want to learn about other similar things related to your industry.  So, in a way, they’ve raised their hand to let you know they like this kind of content.

So why not give them more?

With retargeting, you’ve already identified them as someone who consumed your content, and now you can show them more related content to get them back to your site and hopefully into your sales funnel.

So let’s jump into setting up this fancy ‘tracking pixel’, shall we?

Facebook Ad Manager

The first thing to do is to log into your Facebook Ad Manager.  You can do that with a link on the left of your home screen, or you may have to use the drop-down to find it.


The next page should have a header that looks similar to this:


Don’t see those buttons? Try this link.

Next, select Audiences under the Tools tab

Choose Create a Custom Audience

Next, select Website Traffic (because that’s what we want the audience to be created from – all the people that visit your website from today on)

You may get a notification to accept the Terms of Service (TOS).  Do so.

Next, you’ll get a block of code.  This is your tracking code!  Select it and copy it.  It’s my recommendation that you paste it into a text/Notepad file and save it to a file on your PC.  That way if you need it, you have it.

Now, change the following two boxes.  First, the ‘In the Last’ to 180.  This is the max days you can track a website visitor.

Secondly, change the Audience name to something that makes sense.  I usually use All Traffic, 180 Days.  Simple enough, right?

Then click Create Audience

Adding the Tracking Code to Your Website

Now we’ve got to get that code that you copied onto your website.  For WordPress users, this is fairly simple (see below).

For users of other platforms, you may need to contact your web person so they can get the code onto every page of your site correctly.  Contact us if you need help with this step.

For WordPress users, this can be done a few different ways. The best way to do it is to see if your theme has a special section for extra code.  You’ll typically find this in the Theme Options under Settings or Appearance.

DO NOT put this code in a Custom CSS type block.

If you found the place in your theme for the custom code, paste it in there and hit Save.  You’re done and tracking visitors!

If you cannot find a place to put the code in the Theme Options, then click on Plugins and Add New

In the search box, type ‘tracking code manager’ – you should see a plugin listed there by IntellyWP.  Install and activate the plugin.

Now you should see the plugin when you go to Settings and then Tracking Code Manager

Now click the Add new Tracking Code button

In this step, there are 5 things that you need to do.

  1. Set the code to Active
  2. Name your code – I call mine ‘Facebook Audience
  3. Paste the code just as Facebook gave it to you in the big box
  4. Where it says ‘Position inside the code’, select Before </HEAD>
  5. Check the box for Standard code tracking in your WordPress

Now click Save

Congratulations! You are now tracking visitors on your WordPress site!

One Response

Leave a Reply

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

Related Posts