How to Add the Facebook (Meta) Pixel to Your Website: WordPress, Shopify, Wix, Google Tag Manager and Custom Sites

If you run Facebook or Instagram ads, the Meta Pixel is how Meta learns who bought, who signed up and who just looked. Without it, your ads optimise in the dark and you can't retarget visitors. With Apple's privacy changes still biting and Chrome starting to phase out third-party cookies in January 2024, a pixel on its own isn't enough any more either. This guide covers installing the Meta Pixel on every common platform, choosing the right events, adding the Conversions API and checking that it all works.

← Back to all articles
Update · November 2026

We first published this guide in February 2024 and have now updated it. The installation steps still apply, but Meta has changed several things since: it reportedly dropped the eight-event limit for website conversions, tightened rules on health and financial data, and in April 2026 launched a one-click Conversions API and an AI feature that adds product details to pixel events. See What has changed since 2024 for the details.

Key takeaways

  • Same tool, new name. The Facebook Pixel was renamed the Meta Pixel. Most people still search for the old name.
  • The base code goes in the head of every page. It records a PageView automatically; everything else is an event you add.
  • Seventeen standard events cover most needs. Purchase, Lead, AddToCart, CompleteRegistration and the rest are what Meta's ads system understands best.
  • Pair the pixel with the Conversions API. Sending the same events from your server fills gaps left by ad blockers and browser privacy settings. Matching event names and IDs stop double counting.
  • Platforms make it easy. Shopify, WordPress, WooCommerce, Wix and Squarespace all have built-in or official integrations, so most businesses never touch code.

What is the Meta Pixel?

Definition

The Meta Pixel (formerly the Facebook Pixel) is a piece of JavaScript code from Meta that you add to your website. It records what visitors do, such as viewing a page, adding to cart or completing a purchase, and sends those events to Meta. Meta uses them to show your ads to people likely to take the same action, build retargeting audiences, and report which ads led to results. The Conversions API sends the same kinds of events directly from your server instead of the visitor's browser, so you still get data when the browser blocks or limits the pixel.

Think of the pixel as the feedback loop for your ads. Meta's delivery system decides who sees your ad based on who has converted before. If it can't see conversions, it guesses. Advertisers without a pixel usually end up optimising for clicks or reach, which are cheap but rarely what the business actually wants.

The pixel also powers custom audiences: people who visited your site, viewed a product or started checkout. Retargeting those people with a reminder is often the most efficient spend in a Meta ads account.

Why it matters more now

Three changes have made accurate pixel setup more important, not less.

  • Apple's App Tracking Transparency. Since iOS 14.5 in April 2021, iPhone users can refuse tracking across apps, and many do. Meta processes web events from those users with limitations, so conversions are under-reported unless your setup is strong.
  • Browsers and ad blockers. Safari and Firefox limit tracking scripts and cookies, and ad blockers often block the pixel completely. Chrome began restricting third-party cookies for 1% of users on 4 January 2024 as a first step. The pixel's own cookie is first-party, but the direction of travel is clear: browser-only tracking keeps losing data.
  • Privacy law. GDPR in Europe and India's Digital Personal Data Protection Act, 2023, both make consent and careful data handling part of tracking, not an afterthought.

That's why Meta now recommends using the pixel together with the Conversions API. Each one covers the other's gaps.

What the data shows

A few numbers frame the setup decisions in this guide.

The Meta Pixel in four numbers

17standard events Meta's ads system recognisesMeta for Developers
48 hrswindow in which Meta matches pixel and server events to avoid double countingMeta for Developers
1%of Chrome users had third-party cookies restricted from 4 January 2024Google Chrome, Privacy Sandbox
8 → 39Google Trends interest in "meta pixel", July 2022 to January 2024Google Trends, data to 28 Jan 2024
Figure 1. Search interest is relative; "facebook pixel" still ran at roughly twice the interest of "meta pixel" in January 2024.

Search interest: Google Trends, July 2022 to January 2024

We compared "facebook pixel", "meta pixel" and "conversions api" in Google Trends (worldwide, web search, data to the week of 28 January 2024). Each line is measured against the busiest week for any of the three, which scores 100.

Google Trends interest in facebook pixel, meta pixel and conversions api, July 2022 to January 2024Line chart. facebook pixel stays high, between about 58 and 100, peaking at 100 in the week of 18 September 2022 and at 83 in the latest week; meta pixel rises steadily from 8 in July 2022 to 39 in the week of 28 January 2024; conversions api stays between 2 and 6.“Meta pixel” searches grew fivefold as the old name lingeredGoogle Trends, worldwide, weekly interest (100 = busiest week for any term in the period). Jul 2022 – Jan 2024.0255075100Jul 22Oct 22Jan 23Apr 23Jul 23Oct 23Jan 24facebook pixelmeta pixelconversions apimeta pixel · 39Source: Google Trends, worldwide web search, pulled 15 Feb 2024. Relative interest, not absolute volume.
Figure 2. "facebook pixel" stayed between about 58 and 100 throughout. "meta pixel" grew from 8 in July 2022 to 39 in late January 2024 as the new name caught on. "conversions api" stayed in single digits.
  • The old name still wins. Two years after the rebrand, most people still search for "facebook pixel".
  • The new name is catching up. "meta pixel" interest roughly quintupled over the period.
  • Few people search for the Conversions API. Most advertisers haven't set it up yet, which is a gap worth closing.

How the pixel and Conversions API work together

The two send the same event from two places. Meta keeps one copy.

Infographic: a visitor buys; the Meta Pixel in the browser and the Conversions API from the server both send a Purchase event with the same event ID; Meta matches them within 48 hours and keeps one; ads then learn from it.
Figure 3 (tap to enlarge). Give both copies the same event name and event ID, and Meta counts the purchase once.
Table 1. Pixel, Conversions API, or both?
Meta Pixel onlyConversions API onlyBoth (recommended)
Runs inVisitor's browserYour server or platformBoth
Blocked by ad blockersOftenNoServer copy still arrives
Setup effortLowMedium to highLow on platforms with integrations
Retargeting audiencesYesLimited without browser IDsBest
Data completenessWeakestGoodStrongest

Step 1: Create your pixel in Events Manager

You need a Meta Business account (Business Manager) with access to your ad account.

  1. Open Events Manager from Meta Business Suite or Ads Manager.
  2. Choose Connect data sources, then Web, then Meta Pixel.
  3. Name it after your business or website and enter your website address. Meta may suggest a partner integration if it detects your platform.
  4. Note the Pixel ID, a long number. Most platform integrations only need this ID.

Use one pixel per website in most cases. Several pixels on one site split your data and confuse optimisation. Make sure the pixel belongs to your business account, not to a freelancer's or agency's account, so you keep it if they move on.

Step 2: Install the pixel

There are three ways to install it. Pick one, never two.

  • Partner integration. The easiest. Your platform adds the code and often the Conversions API for you.
  • Google Tag Manager. Best if you already manage tracking in GTM.
  • Manual code. For custom-built sites, or when you need full control.

WordPress and WooCommerce

Meta's official plugin for WordPress adds the pixel and can send events through the Conversions API. Install it from the WordPress plugin directory, connect your Meta business account and choose your pixel. For online stores on WooCommerce, use Meta's official Facebook for WooCommerce extension instead; it installs the pixel, sends ecommerce events such as AddToCart and Purchase, and syncs your product catalogue for shopping ads. Don't combine these with a theme setting or another tracking plugin that also adds the pixel.

Shopify

Install Meta's Facebook & Instagram app from the Shopify App Store and connect your business account, ad account and pixel. In its data sharing settings you choose a level: Standard uses the pixel only, while Enhanced and Maximum add customer information and server-side events through the Conversions API. Maximum gives the most complete data, provided your privacy policy covers it. Remove any pixel code pasted into your theme files first, or every event is counted twice.

Wix

In the Wix dashboard, open Marketing Integrations, choose Facebook Pixel & CAPI, and enter your Pixel ID. Wix places the code and sends standard ecommerce and booking events where relevant.

Squarespace

Squarespace has a built-in field for your Pixel ID in its settings, and it sends standard commerce events such as purchases automatically. Use code injection only if you need events Squarespace doesn't cover.

Google Tag Manager

If GTM is already on your site, add the pixel there rather than in your code. Create a tag using a Meta Pixel template from the Community Template Gallery, or a Custom HTML tag containing the base code, with your Pixel ID. Set its trigger to All Pages. Then create separate tags for each event, triggered by the actions that matter, such as a thank-you page view or a form submission. If you use custom HTML event tags, use tag sequencing so the base code always fires first. Our guide to setting up Search Console, Tag Manager and GA4 covers installing GTM itself.

Custom-built websites

Copy the base code from Events Manager and place it between the opening and closing <head> tags of every page, in your shared header template or root layout. Meta recommends the head because the code loads sooner and is less likely to be blocked by other scripts. The base code loads Meta's library and records a PageView each time a page loads; leave that call in place. On single-page apps that change pages without reloading, fire a PageView on each route change so navigation is recorded.

Step 3: Set up the right events

The base code only records page views. Events tell Meta what counts as success.

Infographic: which Meta standard events to track. Online store: ViewContent, AddToCart, InitiateCheckout, Purchase. Services and lead generation: Contact, Schedule, CompleteRegistration, Lead. SaaS and apps: CompleteRegistration, StartTrial, Subscribe. Publishers: ViewContent, Search, Subscribe.
Figure 4 (tap to enlarge). Track the steps in your funnel, and optimise ads for the final one.

Meta recognises 17 standard events: AddPaymentInfo, AddToCart, AddToWishlist, CompleteRegistration, Contact, CustomizeProduct, Donate, FindLocation, InitiateCheckout, Lead, Purchase, Schedule, Search, StartTrial, SubmitApplication, Subscribe and ViewContent. Use these names wherever they fit, because Meta's ad optimisation understands them without extra setup. Use custom events only for actions none of them describe.

On a custom site, a purchase event looks like this, fired on the order confirmation page:

fbq('track', 'Purchase', {value: 2499, currency: 'INR'}, {eventID: 'ord_123'});

Always include a value and currency with purchases so Meta can optimise for revenue rather than order count alone. The eventID in the last part is what lets Meta match this browser event with the same event sent through the Conversions API.

If you'd rather not write code, Events Manager has an event setup tool that lets you click buttons and pages on your live site to define events. It works for simple sites, but breaks easily when your design changes, so check it after every redesign.

Step 4: Add the Conversions API

The Conversions API sends events from your server, so they arrive even when the browser blocks the pixel. There are three routes, from easiest to most technical.

  1. Platform integrations. Shopify's Facebook & Instagram app (Enhanced or Maximum data sharing), Facebook for WooCommerce, Meta's WordPress plugin and Wix all offer server events with a few clicks.
  2. Conversions API Gateway. A Meta-provided setup that runs in your own cloud account and mirrors pixel events server-side, without custom development. It has hosting costs.
  3. Direct integration. Your developer sends events from your backend to Meta's API. Most flexible, most work.

Whichever route you use, follow two rules. First, deduplicate: give each event the same event name and the same event ID in both the pixel and the server event. Meta treats two events as duplicates only when both match, and only within 48 hours, keeping the first one it receives. Second, send customer information such as a hashed email or phone number with server events where your privacy policy allows. Meta's Event Match Quality score in Events Manager shows how well your events can be matched to Meta accounts; higher is better.

Step 5: Verify your domain and test

  1. Verify your domain

    In Business Settings, under Brand Safety, add your domain and verify it with a DNS TXT record, a meta tag or an HTML file. Domain verification proves you own the site and is needed to configure web events properly.

  2. Install Meta Pixel Helper

    This free Chrome extension shows which pixels and events fire on any page, and flags errors such as duplicate pixels or missing parameters.

  3. Use Test Events

    In Events Manager, open your pixel's Test Events tab, enter your site URL and browse. Browser and server events appear in real time, so you can confirm both arrive and are deduplicated.

  4. Complete a real conversion

    Submit a test enquiry or place a low-value order, then check that the event shows the right value and currency.

  5. Watch diagnostics for a week

    Events Manager's Diagnostics tab lists problems Meta spots over time, such as events losing parameters or sudden drops.

Privacy and consent

Tracking visitors comes with legal duties. If you have visitors from the European Union or the UK, you generally need consent before the pixel sets cookies or sends data. Use a consent management platform that holds the pixel until the visitor agrees; the pixel supports fbq('consent', 'revoke') and fbq('consent', 'grant') to pause and resume tracking. In India, the Digital Personal Data Protection Act, 2023, sets out consent and notice requirements for personal data, with detailed rules still to come. Whatever your market, never send sensitive information to Meta: no names or health details in URLs, no form contents in event parameters, and nothing your privacy policy doesn't cover. Health, finance and other sensitive businesses should be especially careful about what their pages and events reveal.

Meta Pixel setup checklist

Run through this after setup, and again after any site redesign.

Meta Pixel and Conversions API check

  • Pixel owned by your business account
  • One pixel, installed one way only
  • Base code on every page
  • Standard events for each funnel step
  • Value and currency on purchases
  • Conversions API connected
  • Matching event IDs for deduplication
  • Domain verified
  • Tested with Pixel Helper and Test Events
  • Consent banner controls the pixel, if required
  • No sensitive data in URLs or parameters
Figure 5. Eleven checks for reliable Meta tracking.

Common mistakes

These turn up in almost every ad account audit.

  • Two installations. A plugin and theme code, or an app and GTM, both firing the pixel. Every conversion doubles and optimisation goes wrong.
  • Purchase on the wrong page. Firing Purchase on the checkout page instead of the confirmation page counts abandoned carts as sales.
  • No value on purchases. Meta can't optimise for revenue or report return on ad spend.
  • Server events without deduplication. Adding the Conversions API without matching event IDs double counts everything.
  • Pixel in someone else's account. When the agency or freelancer leaves, your data and audiences go with them.
  • Custom events for everything. Meta optimises best on standard events; use custom ones only when nothing else fits.
  • Sensitive data in URLs. Form pages that put email addresses or health details in the URL send that data to Meta with every page view.

What has changed since 2024

We added this section in November 2026. Everything above still applies; this section covers what Meta has changed since we first wrote it.

  • 2025: health and financial data restrictions. Meta tightened controls on data from websites in sensitive categories such as health and finance. Depending on how Meta classifies a site, it may strip custom parameters and URL details, restrict certain events or hold custom events for review. Reports also describe a September 2025 rule restricting custom conversions whose names suggest health or financial categories. If Events Manager warns you about restricted data, review what your URLs, parameters and event names reveal.
  • June 2025: the eight-event limit for websites. Several industry sources report that Meta stopped requiring advertisers to choose and rank eight conversion events per domain for website campaigns, a limit introduced after Apple's iOS 14.5 changes. Meta's documentation on this is thin, so check the current guidance in Events Manager, especially for app campaigns.
  • 15 April 2026: AI-enriched pixel and one-click Conversions API. Meta announced that the pixel can use AI to add details such as product names and availability to events, with existing users given 30 days' notice and the option to turn it off in Events Manager. It also launched a free, one-click Conversions API setup in Events Manager that creates a server connection alongside your pixel and deduplicates automatically. Meta says advertisers using the Conversions API for web events saw an average 17.8% lower cost per result, which is Meta's own figure. The one-click option mirrors whatever the pixel sends and doesn't let you choose events or parameters, so businesses with strict data rules may still prefer a configured integration.
  • New troubleshooting extension. Meta's pixel documentation now points to the Meta Ads Data Advisor Chrome extension for troubleshooting.

For the wider picture of collecting customer data responsibly, see our first-party data strategy guide and our guide to consent mode and server-side tracking.

Frequently asked questions

Is the Facebook Pixel the same as the Meta Pixel?

Yes. Facebook's parent company renamed itself Meta and the pixel became the Meta Pixel. It works the same way and is managed in Meta Events Manager.

Where do I put the Meta Pixel code?

Between the opening and closing head tags on every page of your site, usually in a shared header template. On Shopify, WordPress, Wix and Squarespace, use the official integration instead of pasting code.

Do I need the Conversions API if I have the pixel?

Meta recommends using both. The pixel misses events when browsers or ad blockers stop it, and the Conversions API sends those events from your server. Use matching event names and IDs so Meta counts each event once.

Can I install the Meta Pixel with Google Tag Manager?

Yes. Add the base code with a Meta Pixel community template or a Custom HTML tag that fires on all pages, then add separate tags for each event. Don't also install the pixel through a plugin or theme.

How do I check if my Meta Pixel is working?

Use the Meta Pixel Helper Chrome extension to see which events fire on a page, and the Test Events tab in Events Manager to watch browser and server events arrive in real time.

Which events should I track?

The steps in your sales funnel. For online stores, ViewContent, AddToCart, InitiateCheckout and Purchase. For service businesses, Contact, Schedule and Lead. Optimise your ads for the final step.

What is a Facebook pixel, in simple words?

It is a small piece of code on your website that tells Meta when someone who saw or clicked your ad does something on your site, such as viewing a page, filling a form or buying. With that information, Meta shows your ads to people more likely to enquire, and lets you show ads again to people who visited but didn't contact you.

Facebook pixel kya hai?

Facebook (Meta) pixel ek chhota code hai jo aapki website pe lagta hai. Yeh Meta ko batata hai ki aapka ad dekhne ke baad kisne website pe form bhara, call kiya ya kharida. Isse aapke ads sahi logon tak pahunchte hain aur aap un logon ko dobara ad dikha sakte hain jo website pe aaye par contact nahi kiya.

The bottom line

The Meta Pixel is the difference between Meta ads that learn and Meta ads that guess. Create the pixel in your own business account, install it once through your platform's official integration or Tag Manager, track the standard events that match your funnel with values on purchases, add the Conversions API with matching event IDs, verify your domain and test everything. Then respect your visitors' choices about tracking. If you'd like experienced help, our social media marketing team sets up and audits Meta tracking for online stores and service businesses. Book a free consultation and we'll check what your pixel is really recording.

Sources

  1. Google Trends, worldwide web search for "facebook pixel", "meta pixel" and "conversions api", July 2022 to January 2024.
  2. Meta for Developers, "Meta Pixel: get started". developers.facebook.com
  3. Meta for Developers, "Meta Pixel reference" (standard events). developers.facebook.com
  4. Meta for Developers, "Handling duplicate pixel and Conversions API events". developers.facebook.com
  5. Google, Privacy Sandbox, "Tracking Protection" testing for 1% of Chrome users from 4 January 2024. privacysandbox.com
  6. Government of India, Digital Personal Data Protection Act, 2023. meity.gov.in
  7. PPC Land, "Meta upgrades Pixel and Conversions API to close the gap for small advertisers", April 2026. ppc.land
  8. PPC Land, "Meta's free one-click Conversions API is now live", April 2026. ppc.land
  9. Jon Loomer Digital, "Aggregated Event Measurement". jonloomer.com
  10. Freshpaint, "Meta's new data restrictions for healthcare". freshpaint.io

This article is for general information only and is not professional advice. Tools, prices and platform rules change often, so please check official sources before acting on it. See our Terms & Conditions.

Want your Meta ads tracking set up properly?

Talk to our experts. Your first consultation is free.