Guide

How to Set Up the Meta Pixel on Your Website

The Meta Pixel is a small piece of JavaScript code that sits on your website and sends data back to Meta about what visitors do after they click one of your Facebook or Instagram ads. Without it, you are running campaigns essentially blind — spending money without knowing which ads are actually producing enquiries, sales, or sign-ups.

Setting up the Pixel sounds technical but the process is straightforward, especially if you are using a common website platform. This guide walks through the steps from creating your Pixel in Meta Business Suite to verifying it is working correctly.

Creating your Pixel in Meta Business Suite

Before you can install the Pixel, you need a Meta Business Suite account connected to your Facebook Page. Log in to business.facebook.com, go to the Events Manager section from the left-hand menu, and click Connect a Data Source. Choose Web, then name your Pixel something descriptive — usually your business name followed by "Pixel" works fine.

Once created, Meta will offer you several installation methods. If your website is built on a supported platform such as Shopify, WordPress with WooCommerce, or Squarespace, there is often a native integration that lets you connect without touching any code. If you are on a custom-built site, you will need to manually add the base Pixel code to every page.

The base code snippet is provided in Events Manager. Copy it and paste it into the head section of your website — ideally just before the closing head tag. This base code fires on every page load and enables basic tracking. Without it, none of your event tracking will work.

Setting up standard events

The base Pixel tracks page views by default, but to measure meaningful actions you need to set up standard events. Meta defines these as predefined actions such as ViewContent (someone views a product page), AddToCart, InitiateCheckout, and Purchase. For service businesses, Lead (someone submits an enquiry form) is usually the most important event to track.

You can add standard events either by editing your website code directly or by using Meta’s Event Setup Tool, which lets you visually click on elements of your page and assign events to them without writing code. For most small businesses the Event Setup Tool is the easier option.

Once your key events are set up, go back to Events Manager and check the Test Events tab. Open your website in another tab and trigger the events — submit a test enquiry, add something to cart, reach the thank-you page — and watch them appear in the test tool in real time. This confirms everything is firing correctly before you start spending on ads.

Pixel, consent, and GDPR compliance

In the UK and EU, you must obtain valid cookie consent before firing the Meta Pixel for non-essential tracking. Implement a cookie consent banner that blocks the Pixel from loading until the user accepts. Most cookie consent platforms — Cookiebot, CookieYes, Usercentrics — have built-in integrations with Meta that handle this automatically.

Failing to implement consent correctly exposes your business to regulatory risk and can also affect data quality if Meta receives inconsistent signals. Take the time to set up consent properly from the start rather than retrofitting it later. Your ad performance may be slightly lower than if all users were tracked, but this is the legal and ethical approach.

FAQs

Common questions.

Can I have more than one Meta Pixel on my website?
Technically you can, but it is not recommended. Multiple Pixels on the same site can cause events to fire twice and corrupt your conversion data. If you are working with an agency, share access to your existing Pixel rather than creating a new one.
Does the Meta Pixel still work with iOS privacy changes?
Apple’s App Tracking Transparency changes reduced the amount of data the Pixel receives from iOS users. Meta introduced Aggregated Event Measurement to work within these constraints. Verifying your domain in Meta Business Suite and configuring your events properly helps maximise the data you can still capture.
How long should I wait before the Pixel starts showing useful data?
You will see real-time events in the Test Events tool immediately. For meaningful audience data and optimisation, Meta typically recommends accumulating at least fifty conversion events per week before the algorithm can optimise effectively. This can take days or weeks depending on your traffic volume.
Related guides

More on web design & ux.

Want a hand putting this into practice?

Book a free, no-obligation consultation with a Norwich-based specialist.

Book a free consultation
Get started

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.

  1. 01
    Tell us a bitFill in the form — two minutes, tops.
  2. 02
    We'll call you backWithin one working day, no pressure.
  3. 03
    Get a clear planHonest advice and a fixed quote.

Free · No obligation · We reply within one working day

Book a free consultation