← Clarigital·Clarity in Digital Marketing
Facebook & Instagram Ads · Session 8, Guide 1

Meta Pixel Implementation · Setup, Events & GTM

The Meta Pixel is the JavaScript tracking tag that connects your website activity to Meta's advertising platform — enabling conversion tracking, remarketing audiences, and the optimisation data that powers Smart Bidding. This guide covers base code installation, every standard event, custom event creation, Google Tag Manager integration, and how to verify the pixel fires correctly before campaigns go live.

Meta Ads2,900 wordsUpdated Apr 2026

What You Will Learn

  • What the Meta Pixel does and how it connects to Meta advertising
  • How to install the base pixel code on your website
  • All 17 standard Meta events and what each tracks
  • How to fire custom events for actions not covered by standard events
  • Setting up the Meta Pixel through Google Tag Manager
  • Using Meta Pixel Helper and Events Manager to verify correct firing
  • What pixel health score means and how to improve it

What is the Meta Pixel

The Meta Pixel (also called the Facebook Pixel) is a snippet of JavaScript code placed on your website that sends data back to Meta when users take specific actions. Each time a pixel event fires, Meta records it and associates it with any Meta ad click or view that brought the user to your site within the attribution window.

This data serves three purposes: conversion tracking (measuring which ads drive purchases, leads, sign-ups); remarketing audience building (creating Custom Audiences from visitors who took or did not take specific actions); and optimisation signal (providing Meta's algorithm with the data it needs to find users most likely to convert).

Pixel ID

1 per ad account

One pixel per website; one ad account can have multiple pixels

Attribution window

7-day click

Default: 7-day click, 1-day view (configurable)

AEM limit

8 events

Maximum prioritised events per domain under iOS 14+ AEM

Base Code Installation

The base pixel code (also called the pixel base code or global site tag) must be installed on every page of your website — in the <head> section, before the closing </head> tag. This base code initialises the pixel and sends a PageView event automatically on every page load.

<!-- Meta Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
</script>
<noscript>
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=YOUR_PIXEL_ID&ev=PageView&noscript=1"/>
</noscript>
<!-- End Meta Pixel Code -->

Replace YOUR_PIXEL_ID with your actual Pixel ID (found in Events Manager → Data Sources → your pixel). The <noscript> fallback fires a server-side PageView for users with JavaScript disabled.

Finding your Pixel ID

In Meta Business Manager: Events Manager → Data Sources → select your pixel → Settings tab. The Pixel ID is the 15–16 digit number at the top. Your pixel must be associated with your Business Manager account (not just a personal ad account) for full functionality.

Standard Events

Standard events are Meta's predefined conversion event types — each with a consistent name and parameter structure. Using standard events (rather than custom event names) enables Meta's optimisation and reporting features that are not available for arbitrary custom event names.

Event NameCodeWhen to FireKey Parameters
PageViewfbq('track','PageView')Every page load (fires automatically with base code)None required
ViewContentfbq('track','ViewContent')Product detail page viewcontent_ids, content_type, value, currency
Searchfbq('track','Search')Site search performedsearch_string, content_ids
AddToCartfbq('track','AddToCart')Item added to cartcontent_ids, content_type, value, currency
AddToWishlistfbq('track','AddToWishlist')Item saved/favouritedcontent_ids, value, currency
InitiateCheckoutfbq('track','InitiateCheckout')Checkout process begunnum_items, value, currency
AddPaymentInfofbq('track','AddPaymentInfo')Payment details enteredvalue, currency
Purchasefbq('track','Purchase',{value:99.00,currency:'GBP'})Order confirmedvalue, currency (required), content_ids, order_id
Leadfbq('track','Lead')Lead form submittedvalue, currency, content_name
CompleteRegistrationfbq('track','CompleteRegistration')Account/newsletter signupvalue, currency, status
Contactfbq('track','Contact')Contact form submittedNone required
CustomizeProductfbq('track','CustomizeProduct')Product customiser usedcontent_ids, value
Donatefbq('track','Donate')Donation completedvalue, currency
FindLocationfbq('track','FindLocation')Store locator usedNone required
Schedulefbq('track','Schedule')Appointment bookedNone required
StartTrialfbq('track','StartTrial')Free trial startedvalue, currency, predicted_ltv
Subscribefbq('track','Subscribe')Paid subscription startedvalue, currency, predicted_ltv

Custom Events

Custom events track actions on your site that do not fit standard event categories. They use fbq('trackCustom', 'EventName', {parameters}) with any name you choose:

// Custom event — button click
document.getElementById('watch-demo-btn').addEventListener('click', function() {
  fbq('trackCustom', 'WatchDemoClick', {
    page: window.location.pathname,
    button_text: 'Watch Demo'
  });
});

// Custom event — scroll depth
window.addEventListener('scroll', function() {
  if (window.scrollY > document.body.scrollHeight * 0.75 && !scrollFired) {
    scrollFired = true;
    fbq('trackCustom', 'ScrollDepth75', { page: window.location.pathname });
  }
});

Custom events can be used for campaign optimisation only if they are also configured as Custom Conversions in Events Manager. To convert a custom event into a trackable conversion: Events Manager → Custom Conversions → Create Custom Conversion → select your custom event.

Google Tag Manager Setup

GTM is the recommended method for implementing the Meta Pixel on most websites — it avoids modifying site code directly and allows event management without developer involvement for subsequent changes.

GTM implementation steps

  1. In GTM, create a new Tag → Tag Type: Custom HTML
  2. Paste the full Meta Pixel base code (with your Pixel ID) into the HTML field
  3. Trigger: All Pages (fires the PageView automatically on every page)
  4. Save and name the tag (e.g. "Meta Pixel — Base Code")

Adding standard events via GTM

For each conversion event, create a separate GTM tag:

  1. New Tag → Custom HTML
  2. HTML: <script>fbq('track', 'Purchase', {value: {{DL - ecommerce.purchase.totalPrice}}, currency: 'GBP'});</script>
  3. Trigger: the specific page or data layer event where this conversion occurs (e.g. Order Confirmation page URL, or a GTM trigger for the checkout_complete data layer event)

Meta also offers a native GTM template in the Community Template Gallery — search "Facebook Pixel" in GTM's Template Gallery for a structured setup that reduces manual code entry.

Verification

Meta Pixel Helper (Chrome extension)

The Meta Pixel Helper Chrome extension (available in the Chrome Web Store) shows which pixel events fire on any page you visit. Install it, then visit your website and complete a test conversion. The extension shows: which pixel IDs are firing, which events fired, the event parameters sent, and any errors.

Events Manager Test Events

In Events Manager → your pixel → Test Events tab: enter your website URL. Meta opens the site in a frame and displays all events firing in real time. More detailed than Pixel Helper — shows full parameter values, event timing, and whether events are being deduplicated with CAPI.

What to verify before campaign launch

  • PageView fires on every page (check 3–5 different pages)
  • Purchase event fires on the order confirmation page with correct value and currency
  • Purchase event does NOT fire on any other page
  • event_id parameter matches between pixel and CAPI (for deduplication)
  • No duplicate event firing (e.g. Purchase firing twice on one order)

Pixel Health Monitoring

Events Manager provides a pixel health overview showing event volume trends, event match quality, and any detected issues. Key health indicators to monitor:

  • Event volume. If Purchase event volume drops suddenly, it may indicate a pixel break from a website update. Monitor weekly — sudden drops need immediate investigation.
  • Event Match Quality score. A 0–10 score showing how well Meta can match your pixel events to Meta user accounts. Improve by enabling Advanced Matching (passing hashed email/phone at event time) and implementing CAPI alongside the pixel.
  • Duplicate events. If the same event appears to be firing multiple times per conversion, check for double-installed base code or missing event_id deduplication with CAPI.
  • Missing required parameters. Events Manager flags events missing recommended parameters (e.g. Purchase without value/currency) — add them to improve catalogue and dynamic ad functionality.

Authentic Sources

OfficialMeta for Developers — Meta Pixel

Complete Meta Pixel technical documentation including base code, events, and parameters.

OfficialMeta Business Help — Set Up Meta Pixel

Step-by-step pixel setup guide for non-developers.

OfficialMeta for Developers — Pixel Standard Events

Full reference for all 17 standard events and their parameters.

OfficialMeta Business Help — Meta Pixel Helper

Installing and using the Pixel Helper Chrome extension.

600 guides. All authentic sources.

Official documentation only.