Set up Meta Pixel with GTM.
If you run Facebook or Instagram ads, the Pixel tells Meta what happens after someone clicks. Without it, Meta is guessing. This guide walks you through installing it with Google Tag Manager, step by step.
What Meta Pixel does for you.
The Pixel is the bridge between your website and your Meta ad campaigns.
Tracks what visitors do after clicking your ad
When someone clicks your Facebook or Instagram ad, the Pixel records what they do on your website: which pages they visit, whether they submit a form, whether they call. Without it, Meta only knows someone clicked, not what happened next.
Helps Meta show your ads to the right people
Once Meta knows which visitors actually enquired or bought, it can find more people like them. This is conversion optimisation. Without the Pixel, Meta can only optimise for clicks, not results.
Lets you retarget website visitors
Someone visited your pricing page but didn't enquire? The Pixel lets you create a Custom Audience of those visitors and show them a follow-up ad. This is retargeting, and it only works with the Pixel installed.
Gives you real numbers, not guesses
With the Pixel, your Meta Ads Manager shows which campaigns, ad sets and ads are actually generating enquiries. Without it, you are spending money with no way to know what is working.
How it works, visually.
The journey from ad click to recorded conversion.
What you need ready.
Tick off what you already have.
From Pixel ID to working tracking.
Follow these steps in order. The whole process takes about 10 minutes.
-
Get your Pixel ID from Meta Events Manager
Open Meta Events Manager (business.facebook.com/events_manager). In the left panel, click Data Sources. Select your Pixel from the list. Click Settings.
Near the top of the Settings page you will see your Pixel ID. It is a long number, usually 15 to 16 digits. Copy it. You will paste it into GTM in a moment.
Can't find your Pixel? If Data Sources is empty, you need to create one first. Click Connect Data Sources → Web → Meta Pixel → give it a name → Create. Then come back to Settings to get the ID. -
Create a new tag in GTM
Open Google Tag Manager (tagmanager.google.com) and go to your website's container. In the left menu, click Tags, then click New.
Name the tag something clear, like Meta Pixel - PageView. The name is only for you; it does not affect tracking.
-
Find the Meta Pixel template
Click the Tag Configuration area. GTM shows a list of built-in tag types. The Meta Pixel is not in this built-in list.
Scroll to the bottom and click "Discover more tag types in the Community Template Gallery". This opens a gallery of templates made by other companies, including Meta.
Search for Meta Pixel. You will see the official template by Meta. Select it and click Add to workspace.
Two templates, pick the right one. You may also see an older template called "Facebook Pixel" by facebookarchive. Use the newer Meta Pixel template by Meta instead. It is the officially maintained version. -
Enter your Pixel ID
The template opens with a configuration form. In the Pixel ID field, paste the number you copied from Meta Events Manager.
Under Event Name, select Standard and choose PageView from the dropdown. This is the base event that fires every time someone visits any page on your website.
-
Set the trigger to All Pages
Click the Triggering area below the tag configuration. Select All Pages. This means the Pixel will fire on every page of your website.
Click Save.
-
Preview and test with Tag Assistant
Click Preview in the top-right corner of GTM. Enter your website URL and click Connect.
GTM opens two windows: Tag Assistant in one tab and your website in another. Browse your website normally. In Tag Assistant, look for your Meta Pixel - PageView tag under "Tags Fired" on each page.
- If the tag appears under "Tags Fired": it is working.
- If it appears under "Tags Not Fired": check the trigger (should be All Pages) and the Pixel ID (must match exactly).
-
Test with Meta's own tools
GTM's Tag Assistant confirms the tag fires, but you also want to confirm Meta is receiving the data.
Option A — Meta Events Manager: Go to Events Manager → Test Events tab. Enter your website URL and click Open Website. Browse your site. Events should appear in the Test Events panel as they fire.
Option B — Meta Pixel Helper: Install the free Meta Pixel Helper Chrome extension. Visit your website and click the extension icon. It shows which Pixel events fired on that page and flags any errors.
Both tools are useful. Tag Assistant shows whether GTM sent the tag. Meta's Test Events and Pixel Helper show whether Meta received it. Use both to be sure. -
Publish the container
Back in GTM, click Submit in the top-right corner. Add a version name like "Added Meta Pixel - PageView" and click Publish.
The Pixel is now live. Meta will start collecting data from your website visitors.
It takes time. Meta may need a few hours to show data in Events Manager after you publish. If you tested in Preview Mode and it worked, the setup is correct. Give it time. -
Add a Lead event tag for conversions
The PageView tag tells Meta who visited. But to track enquiries, you need a second tag for the Lead event.
Go to Tags → New. Name it Meta Pixel - Lead. Click Tag Configuration, choose the same Meta Pixel template from your workspace (it is already there, no need to search the gallery again).
Enter the same Pixel ID. Under Event Name, select Standard and choose Lead.
For the trigger, you have two common options:
- Thank-you page: If your form redirects to a thank-you page (like
/thank-you/), create a trigger of type Page View that fires when Page Path equals /thank-you/. - Form submission: If the form stays on the same page, create a trigger of type Form Submission. You may need to enable the built-in Form Submission trigger variable first (Variables → Configure → tick Form Submission).
Save, Preview, test, then Publish.
- Thank-you page: If your form redirects to a thank-you page (like
Standard events explained.
Meta has predefined event names for common actions. Use them so Meta knows what the action means.
Each event is a separate tag in GTM, all using the same Meta Pixel template with the same Pixel ID. You change the event name and the trigger.
What about Conversions API?
Browser-side tracking
The Pixel code runs in the visitor's browser. It is easy to set up (you just did it). But ad blockers and browser privacy settings can block it, which means some conversions go unrecorded.
Server-side tracking
Conversions API sends the same data from your server instead of the browser. Ad blockers cannot stop it. It is more reliable, but setting it up needs developer help or a partner integration (some CRMs and form tools offer it).
Before you close this tab.
| Check | Where | Expected result |
|---|---|---|
| Meta Pixel - PageView tag fires on every page | GTM Preview → Tag Assistant | Tag appears under "Tags Fired" on all pages |
| Meta receives the PageView event | Meta Events Manager → Test Events | PageView event appears when you browse your site |
| Lead event fires on form submit | GTM Preview → submit a test form | Meta Pixel - Lead tag fires on form submission or thank-you page |
| Meta receives the Lead event | Meta Events Manager → Test Events | Lead event appears after form submission |
| No errors in Pixel Helper | Meta Pixel Helper Chrome extension | Green icon, no error messages |
| Container is published | GTM → Submit → Publish | Version number goes up by one |
Common doubts.
What is Meta Pixel?
Meta Pixel is a small piece of tracking code from Meta that records what happens on your website after someone clicks your Facebook or Instagram ad. It helps Meta optimise your ads by showing them to people most likely to take action, and it lets you create retargeting audiences of people who visited your site.
Where do I find my Pixel ID?
Open Meta Events Manager, click Data Sources on the left, select your Pixel, then click Settings. The Pixel ID is a long number, usually 15 to 16 digits. Copy it exactly as shown.
Do I need both PageView and Lead events?
PageView fires on every page and tells Meta who visited your site. Lead or Contact fires only when someone takes a specific action, like submitting a form. You need both: PageView for retargeting audiences, and Lead or Contact for conversion optimisation so Meta can find more people like those who enquired.
Can I install Meta Pixel without GTM?
Yes, by adding the Pixel base code directly to your website's head section. But GTM makes it easier to manage, especially if you also run Google Analytics and Google Ads tracking. With GTM you change tags in one dashboard instead of editing website code each time.
What is the Meta Pixel Helper?
Meta Pixel Helper is a free Chrome extension by Meta. It shows you whether the Pixel is working on any page you visit, which events are firing and whether there are errors. It is useful for testing alongside GTM's Preview Mode.
What about Conversions API (CAPI)?
Conversions API sends event data from your server instead of the visitor's browser. It is more reliable because ad blockers cannot stop it. But setting it up needs developer help or a partner integration. Start with the Pixel first; add CAPI later when your ad spend grows and you want more accurate data.
Other guides in this series
- Google Tag Manager guides — the hub page with all four guides
- Guide 1: How to set up GTM on your website
- Guide 2: How to set up GA4 with GTM
- Guide 3: Google Ads conversion tracking with GTM
Related reading
- Meta Ads service — how I set up and manage Meta Ads for clients
- Meta Ads vs Google Ads for clinics — which platform to start with
- WhatsApp ads vs lead forms — a case study where conversion tracking mattered