Guide 4 of 4 · Google Tag Manager

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.

S Mohammed Safwan, digital marketer in Kerala, explaining Meta Pixel setup
Free guide · No sign-up
Free.Meta Pixel and GTM
9Steps in this guide
No codeGTM template does the work
Guide 4of the GTM series
Why it matters

What Meta Pixel does for you.

The Pixel is the bridge between your website and your Meta ad campaigns.

01

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.

02

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.

03

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.

04

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.

Clicks your adFacebook or Instagram
→
Lands on your siteYour website
→
Pixel fires PageViewMeta records the visit
→
Submits formEnquiry or purchase
→
Pixel fires LeadMeta records the conversion
→
You see itIn Ads Manager reports
Before you start

What you need ready.

Tick off what you already have.

Step by step

From Pixel ID to working tracking.

Follow these steps in order. The whole process takes about 10 minutes.

  1. 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.
  2. 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.

  3. 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.
  4. 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.

  5. 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.

  6. 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).
  7. 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.
  8. 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.
  9. 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.

Beyond PageView

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.

PageViewEvery page visit. Fires on All Pages. You set this up in the guide above.
LeadSomeone submitted an enquiry form. Fires on form submit or thank-you page.
ContactSomeone clicked a phone number, email or WhatsApp link. Fires on specific link clicks.
ViewContentSomeone viewed a key page, like a product or service page. Fires on specific page views.
AddToCartSomeone added a product to cart. For ecommerce sites. Fires on the add-to-cart action.
PurchaseSomeone completed a purchase. For ecommerce. Fires on the order confirmation page.
Start simple. For most service businesses (clinics, B2B, local businesses), you need just two events: PageView on all pages and Lead on form submissions. Add more events only when you need them.
Advanced

What about Conversions API?

Pixel

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.

CAPI

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).

Start with the Pixel. It works well on its own and is what most small businesses use. When your monthly ad spend grows and you want more accurate attribution data, ask a developer to add Conversions API alongside the Pixel. Meta recommends using both together for the best results.
Quick checklist

Before you close this tab.

CheckWhereExpected result
Meta Pixel - PageView tag fires on every pageGTM Preview → Tag AssistantTag appears under "Tags Fired" on all pages
Meta receives the PageView eventMeta Events Manager → Test EventsPageView event appears when you browse your site
Lead event fires on form submitGTM Preview → submit a test formMeta Pixel - Lead tag fires on form submission or thank-you page
Meta receives the Lead eventMeta Events Manager → Test EventsLead event appears after form submission
No errors in Pixel HelperMeta Pixel Helper Chrome extensionGreen icon, no error messages
Container is publishedGTM → Submit → PublishVersion number goes up by one
Questions

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

Related reading

Running Meta Ads and need help with tracking?

Book a consultation