Facebook offers several code snippets that you can install on your site which will greatly increase the effectiveness of your present and future ad campaigns.
Unfortunately, they are not very clear about finding these codes, and it takes a lot of snooping around to even find them. Furthermore, I wasn’t able to find an article online that aggregates all these resources into one place.
Below, I have outlined the main pixels you should consider installing in your site, as well as descriptions on where to find them. I recommend installing all of them at once, to fully optimize your site for Facebook ads.
- Custom audience “Remarketing” Pixel
Facebook allows you to keep track of people who visit your site, and then target them later on with ads that are custom designed for them. For example, you can directly refer to your website in the ad, in a way that you couldn’t if you were target the general population.
Facebook allows you to define your audience by how far back they visited your site (the default is 30 days, but you can extend it to 180). They also allow you to install the code on only certain page, further narrowing in on a segment of your total website audience.
To create this audience, navigate to the “audiences” section in your ads manager (currently under “tools” in the menu). Click the blue “create audiences” button, select custom audiences, and then select “website traffic”.
Easy, right? That’s not all. You will need to define exactly what website you will be targeting, how long back you want to track them, and what part of the website they will be visiting. Click “create audience”, and you will now see a new audience in your list.
To get the pixel, you must click on that audience’s name, which will take you to a new page. This is the page that will show you how many visitors your site has had (and therefore how many people you’ll be targeting with your remarketing ads). Right now it will probably be blank, because you haven’t installed your freaking pixel yet because hasn’t Facebook bothered to give it to you.
Now, click on the “actions” button on the screen, and you will see an option to “view pixel code”. Tada! Copy that code into the header of your ENTIRE SITE and you are in business (even if you are only targeting visitors to specific pages of your site, Facebook will filter them out automatically based on the parameters you defined when you set the audience).
Piece of cake.
Basically, what Facebook has you do is first define your audience and the site they’ll be visiting, and then take the code and install it on your site (most platforms do the opposite).
2. Conversion Pixel
Now that you have the general, site-wide retargeting pixel installed, you can move on to conversion tracking. This is a nifty feature that allows Facebook to optimize your ad campaigns to register specific actions. You can tell them what page your visitors get sent to after they complete a purchase or sign up to your newsletter, and Facebook will then know that a successful transition has taken place and show your ad to similar people.
This is called optimizing for conversions.
It is important to install this code ONLY on the page that visitors will be sent to when the complete the action – the “confirmation page”. I recently had a campaign that failed because the code was mistakenly installed on the landing page – Facebook thought that every visit was a successful conversion, when in reality there was still another step for the visitors to take.
First, visit Facebook’s conversion tracking page, or in the ads manager, click on “tools” and then “conversion tracking”. On the top right of the screen you will see a button that says “create pixel” where you can define what kind of action the person will be taking.
As usual, Facebook doesn’t actually give you the code to install, oh no. You must hover over the name of your newly created pixel (usually named after the action people will be taking, e.g. “Registrations – Mark Zuckerberg”). You will see a little gear appear. Clicking on it will display the code you should install on your confirmation page.
Slightly bigger piece of cake.
3. Insights pixel
I recently ran a campaign, where Facebook said that they had sent hundreds of people to my site, but Google analytics didn’t register any visitors at all. Strange. I still haven’t figured out what was going on there.
But, to get a better understanding, it’s important to not just rely on the numbers Facebook reports in the ad campaign itself. Instead, Facebook has their own simplified analytics platform called Facebook Insights, which they haven’t bothered to tell anyone about.
Facebook insights are primarily used to understand people’s behaviors on your Facebook pages. But it is actually possible to install it for your site as well, which I recommend. Luckily for you, Facebook has made this easy possible.
Navigate to Facebook insights, and on the bottom you will see the option to “add your domain”. Here, for the first time, Facebook gives you the option to install the code and, defined the parameters at the same time. Crazy, right?
Simply install the one line of code in your site-wide header, define your domain, click “get insights” and you are in business.
4. BONUS: likes and comments
That should cover your analytics.
If you’re already in the shvung of installing codes into your site headers, you might also be interested in adding likes and commenting abilities.
To add Facebook comments to your site, Facebook has a much easier to use page where you can define the URL where the comments will be installed, add further tweaks if you want, and get the code which you paste into your site.
They also have a similar page where you can get the code for like and share buttons. However, I recommend installing the far more robust sumome.com plugin, which installs insanely easily with one paragraph of code and includes share buttons, email marketing popups, heat maps, and other goodies, all completely free.
I hope you find this post as helpful as I did (for myself). Feel free to email me if you have any questions about paid advertising or social media in general, and happy pixel pasting!