If you’ve used Facebook for any length of time, you’ll be familiar with Facebook ads in your timeline.
You’ve also probably visited a website, gone to Facebook and then noticed an ad for the very thing you were looking at minutes before!
What’s going on? Is the business psychic?
The truth is that they’re using something called the Facebook pixel to retarget their users. That is, they serve an ad to someone who’s already expressed an interest in their product or service.
All business owners with a Facebook account can take advantage of this technology to reach their most engaged prospects.
If your site runs WordPress, the first part of that process is to add the Facebook pixel to WordPress.
Here are the points I’m going to run through:
- What is the Facebook pixel?
- What kind of data does the Facebook pixel collect?
- I’m not running Facebook ads – do I need the Facebook pixel?
- Where do I get the Facebook pixel?
- How to add the Facebook pixel to WordPress
- Check that the pixel is working
- Update your privacy policy
What is the Facebook pixel?
Facebook’s definition of the Facebook pixel says:
The Facebook pixel is a piece of code for your website that enables you to measure, optimize and build audiences for your ad campaigns.
Facebook used to have two types of pixel – conversion tracking and Custom Audience pixels. They have now consolidated those into one for simplicity.
The pixel itself is a 1×1 px image (a tiny dot that makes up a larger image). When set on a web page, it sends information to a server which sets a cookie in the user’s browser.
Learn more about cookies, tags and pixels
What kind of data does the Facebook pixel collect?
The Facebook pixel will tell you:
- How many people visited your site in a given time period
- Which pages your visitors went to
- What type of device they used (desktop, mobile or tablet)
There are also options to collect data from specific events, such as email signups, views of particular pages or purchases made.
I’m not running Facebook ads – do I need the Facebook pixel?
If you have plans to run Facebook ads in the future, you can start the data collection now. You can retrieve data up to 180 days old.
I won’t go into the how of running Facebook ads in this post.
Suffice it to say that you can gain insights into your audience’s age, gender, job and relationship status via the Facebook pixel. Using this information you can create laser-targeted Facebook ads.
Read more about Facebook custom audiences and creating Facebook ads
- The Importance of the Facebook Pixel
- How to Get Deeper Insights on Your Website Visitors Using the Facebook Pixel
- The Ultimate Facebook Advertising Blueprint
Where do I get the Facebook pixel?
You need a personal Facebook account, and to be logged in.
Choose Create Adverts from the dropdown menu accessible from the white arrow. (I’ve highlighted it with a red border in the screenshot.)
You will momentarily see this:
Then the Facebook Adverts Manager.
Clicking on the hamburger menu is supposed to bring up a mega menu where you can select the Pixels option.
If you find you can’t click on it, as I did, use this link to go directly to the Facebook pixel section of the Ads Manager.
You should see this screen:
Select the Create a Pixel button at the bottom.
Name your pixel – I renamed mine to A Bright Clear Web Pixel.
Read the Facebook pixel terms. Choose Next.
The pixel will be created and you get a confirmation.
Well done! Now you have to add the code to WordPress.
How to add the Facebook pixel to WordPress
Choose how you want to install the pixel.
If you’re using Google Tag Manager already you can go for the first option, Use an integration or tag manager.
Otherwise, choose the second option, copy and paste the code.
Carry out step 1, Install the pixel base code, by copying the generated code.
(In the screenshot, I’ve blanked out the tracking code, which is a numerical ID unique to you.)
You will paste this code into the header section of your website. Your site must be running a self-hosted WordPress.org installation (not WordPress.com) to do this.
Your WordPress theme might have an area in theme settings to do this. My theme (Genesis) does.
Otherwise you can install a plugin like Insert Headers and Footers. This might be a better solution anyway. If you ever switch theme, you won’t lose the pixel.
Go to Settings > Insert Headers and Footers.
Paste the code into the Scripts for Header area and save.
The following step, adding code to specific pages to track events, is something you can leave at this stage. You can add event tracking later when you know what you want to track!
Check that the Facebook pixel is working
Facebook give you a step to follow to make sure the pixel is installed correctly.
I must admit I didn’t bother with this and left it to its own devices. I later got a Facebook notification to say the pixel was up and running.
Facebook have created the Pixel Helper tool to troubleshoot pixel errors. Make sure you have the Chrome browser to install it.
Clicking on the icon in the browser bar will show you the pixel on your site or any other.
Update your privacy policy
Every website should have a privacy policy.
Why? You need to inform your users about the information you collect from them and how you use it.
Let your users know that you are using the Facebook pixel and tell them how they can opt out of data collection.
Not everyone finds using the Facebook pixel appropriate. King County local government authority decided not to use the Facebook pixel because:
…the data Facebook collects from its pixel feature is not anonymous and can be tied to individual users, often by name. This kind of data tracking violates our privacy policy, and is therefore not allowed on King County websites.
Facebook’s page Cookie Consent Resource suggests that the following is a potential case for asking for consent:
A Facebook advertiser who installs the Facebook or Atlas pixel on its website in order to measure ad conversions or retarget advertisements on Facebook
It goes on to suggest that consent could be asked for and given by means of a banner or notice on the website with a button to indicate agreement.
This is very similar to what many companies have done regarding the EU cookie law, with popups and banners saying, “This website uses cookies. Do you accept?”
However, Heather Burns, who writes about laws relating to web professionals, wrote in a recent blog that the EU have acknowledged cookie consent fatigue. From May 2018, the onus will be on web browsers to manage consent.
I asked Heather what her recommendation was regarding the Facebook pixel and user consent.
Use it to have a practice run at a GDPR-compliant information notice, and link to https://t.co/8t7JhdFVkW and https://t.co/Ylgm9TDUZz
— Heather Burns (@WebDevLaw) April 4, 2017
GDPR is the new EU data protection law that comes into force in 2018. It is going to affect everyone that holds personal data on Europeans – whether you live within or outwith Europe. There will be hefty penalties for non-compliance with the new law.
The links Heather recommended are to services that allow opt-outs to advertising services.
I’ve now updated my privacy policy accordingly.
To think about
Are you using the Facebook pixel on your WordPress site?
How are you keeping your users informed about the privacy of their information?
Emily says
Love this step by step process You definitely made it super easy to ad the pixel!!
Claire Brotherton says
Thanks Emily – appreciate you taking the time to comment.
Susan Velez says
Hi Claire,
I actually had to do this for a client about 3 weeks ago. I wish I would’ve had a tutorial like this.
It was all new to me at the time. Which was kind of confusing at the time and probably took me a little longer than it should have.
Your tutorial will definitely save a lot of people time on adding the Facebook Pixel to their WordPress site. Love the pics, it definitely makes it easier to follow along with.
Thanks for sharing your tips with us.
Have a great day 🙂
Susan
Claire Brotherton says
Thanks, Susan. I wish I had written it earlier now! 😉
Gabrielle says
SO much good info, thanks for the post <3 I'll def be adding a pixel myself.
Monica says
Thanks for this clear information!
Claire Brotherton says
Cheers Monica!
Ashley says
Hi! I think I’ve managed through the install on the base code but I can’t quite tell where I should be putting the event code piece of things – if I’m just interested in if a specific thank you page loads – where would I install that piece of the pixel?
Thanks so much!
Ashley
Claire Brotherton says
Hi Ashley
I didn’t get as far as tracking events, but this article looks like it would help: How to Setup Facebook Conversion Tracking in WordPress.
Patrick says
Hi.
I’m looking into putting the Facebook pixel on a website. It doesn’t have a cookies policy because it doesn’t take any data yet – this Pixel will be the first attempt to do that.
Facebook say that –
1. For websites, a clear and prominent notice on each webpage where Facebook Tools are used that links to a clear explanation….. (b) how users can opt-out of the collection and use of information for ad targeting, and…
I’m not sure how to do that and have just looked at your own privacy policy.
Would it be ok to use the text you have done that says –
This site uses the Facebook pixel to collect data on visitor behaviour, such as:
which pages are visited
which device was used to view the website
what actions were taken
This information may be used to serve Facebook ads in future.
You can opt out of collection of information and third party adverts by using the following services:
Digital Adversting Alliance: Opt Out
Your Online Choices
Further reading
WordPress.org privacy policy
Google privacy policy
Facebook privacy policy
Thanks
Claire Brotherton says
Because you asked, Patrick, sure. 🙂
AB Rajputt says
Wow! this looks so great thanks for sharing.
Atul Sharma says
very useful information which has provided step by step process you definitely made it super easy to ad the pixel.
Pallavi Taru says
Hi Claire, Thank you for sharing. Very useful.
Digital Marketing says
Thnaks for information..
Dibakar Bala says
Hi Claire,
Nice Explanation.
I think you should update this article with more methods.
Particularly now we have WordPress plugins specifically dedicated for FB pixel setup.
Although this one is better, yet, they’re also methods one can use.
Less Technical.
sameer says
Hi Claire,
Now there are many methods to add pixels in your WordPress site you can do it directly with WordPress plugin.
Thanks for explaining in soo detail with screenshot
Aman says
Hey, Well Explained about Facebook ads pixel. And thank you for give Facebook unique strategy to learn. Nice information provides.
Saad says
Hey, Well information about Facebook ads pixel and word press and how’s Facebook pixel ads work. So thank you for unique information about different strategy.
Dilawer says
Hey, Well explained about Facebook ads pixel and there WordPress strategies. Thank you for important and informative information’s.
minaxi suthar says
Hey, Thank you for giving a detailed explanation about adding Facebook pixels to WordPress.You made it super easy to understand.
Joseph Donahue says
Hi there! I could have sworn I’ve been to this website before but after reading through some of the post I realized it’s new to me. Anyhow, I’m definitely delighted I found it and I’ll be book-marking and checking back frequently!
Tushar panchal says
Great guide on adding the Facebook Pixel to WordPress! Clear instructions and helpful tips. Thanks for sharing!
Vinith says
Thank you so much for sharing the amazing post. Well, there is information about Facebook ads pixel and WordPress and how Facebook pixel ads work.