How to Set Up the Facebook Pixel on Your Website
If you run or plan to run Facebook or Instagram advertising, the Facebook Pixel (now officially called the Meta Pixel) is one of the most valuable tools available to you. It’s a small piece of tracking code that you install on your website, which then sends data back to Facebook about what visitors do on your site — what pages they view, what products they look at, what they add to a shopping cart, and whether they complete a purchase or enquiry.
This data powers two things: audience targeting (so you can show ads to people who have already visited your site or shown interest in specific pages) and conversion tracking (so you know exactly which ads are driving real results). Without the Pixel, you’re running Facebook ads partly blind. This guide explains how to install it and get the most from it.
How to Install the Facebook Pixel
Log in to Meta Business Suite (business.facebook.com) and navigate to Events Manager. Select Connect Data Sources, then Web, and choose Meta Pixel. Give your pixel a name, enter your website URL, and Meta will generate a pixel ID and a code snippet. You then need to install this snippet on every page of your website, between the opening and closing head tags in the HTML.
If you use WordPress, the easiest method is a plugin like Meta for WordPress or PixelYourSite, which handle installation without requiring you to touch code. Shopify has a native Facebook sales channel integration. Google Tag Manager is another clean option if you’re already using it — you paste the pixel code into a new custom HTML tag and trigger it on all pages. After installation, use Meta’s Pixel Helper browser extension to verify the pixel is firing correctly.
Setting Up Standard Events
Beyond basic page view tracking, the Pixel can track specific actions — called Standard Events — such as a form submission, a product added to cart, or a purchase completed. These events are triggered by additional code snippets or, in some cases, via Meta’s Event Setup Tool, which lets you define events by clicking through your website interface without writing code.
The most important event for most service businesses is the Lead event — triggered when someone submits an enquiry form. For e-commerce, the Purchase event is critical. Setting these up means you can track exactly how many leads or sales each Facebook ad campaign produces, calculate your cost per lead, and optimise your campaigns towards the actions that matter.
Using Pixel Data for Retargeting
Once your Pixel has collected data from at least 100 visitors, you can create Custom Audiences in Meta Ads Manager. For example: everyone who visited your website in the last 30 days; people who visited a specific product or services page but didn’t enquire; people who reached your thank-you page (meaning they did enquire). These audiences let you show highly targeted follow-up ads to people who have already shown interest in your business.
You can also create Lookalike Audiences — Meta analyses the profile of your website visitors or customers and finds other Facebook users with similar characteristics. Lookalike audiences are consistently among the best-performing targeting options in Facebook advertising, and they’re only possible if you have Pixel data to build them from. Installing the Pixel as early as possible, even before you start advertising, means you’re accumulating this valuable data from day one.
Common questions.
Do I need a Facebook ads account to install the Pixel?
Does the Facebook Pixel affect my website’s speed?
Does GDPR affect how I use the Facebook Pixel in the UK?
More on web design & ux.
Want a hand putting this into practice?
Book a free, no-obligation consultation with a Norwich-based specialist.
Let's put your business in a better light.
Book a free, no-pressure consultation. We'll talk through your goals and tell you honestly what we'd do — whether you work with us or not.