adlibrary.com Logoadlibrary.com
Share
How-To

How to Set Up Facebook Pixel for Tracking

AdLibrary image

How to Set Up Facebook Pixel: Complete Guide

What is the Facebook Pixel?

The Facebook Pixel (now Meta Pixel) is a JavaScript code snippet that tracks user actions on your website. It's the foundation of effective Meta advertising.

Without the pixel, you're flying blind. With it, you can:

Why the Pixel Matters in 2026

After iOS 14.5+, tracking became harder. The pixel + Conversions API together recover much of that lost data.

ScenarioTracking Accuracy
No pixel0%
Pixel only40-60%
Pixel + Conversions API80-95%

Step-by-Step: Installing the Meta Pixel

Step 1: Create Your Pixel

  1. Go to Events Manager (business.facebook.com/events_manager)
  2. Click "Connect Data Sources"
  3. Select "Web"
  4. Choose "Meta Pixel"
  5. Name your pixel (use your business name)
  6. Click "Continue"

[SCREENSHOT: Events Manager - Connect Data Sources]

Step 2: Add Pixel to Your Website

Three methods:

Method A: Partner Integration (Easiest)

Meta integrates with major platforms:

  • Shopify
  • WooCommerce
  • Squarespace
  • Wix
  • Webflow

Go to your platform's integrations/settings and connect your Meta account.

For flexibility and control:

  1. Copy your Pixel ID
  2. In GTM, create new tag → "Meta Pixel"
  3. Add Pixel ID
  4. Set trigger to "All Pages"
  5. Publish changes

Method C: Manual Installation

Add the base code between <head> and </head> tags:

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

Step 3: Set Up Standard Events

Events track specific actions. Standard events include:

EventWhen to UseRequired Parameters
PageViewEvery page (automatic)None
ViewContentProduct pagescontent_name, content_ids
AddToCartWhen item addedvalue, currency, content_ids
InitiateCheckoutCheckout startedvalue, currency, num_items
PurchaseAfter paymentvalue, currency, content_ids
LeadForm submissioncontent_name
CompleteRegistrationAccount createdcontent_name

Step 4: Verify Installation

Install the Meta Pixel Helper Chrome extension:

  1. Add extension to Chrome
  2. Visit your website
  3. Click the extension icon
  4. Verify events are firing (green checkmarks)

[SCREENSHOT: Pixel Helper showing successful tracking]

Setting Up Conversions API

Essential for iOS 14.5+ tracking recovery.

Two Setup Options:

MethodDifficultyBest For
Conversions API GatewayEasyMost advertisers
Direct IntegrationTechnicalDevelopers, high volume

Gateway Setup:

  1. In Events Manager, go to your pixel
  2. Click "Settings" → "Conversions API"
  3. Choose "Set up manually"
  4. Follow the guided setup
  5. Generate access token
  6. Add to your website backend

Event Match Quality

Meta scores your event matching (0-10):

ScoreStatusAction
8-10ExcellentNo changes needed
6-7.9GoodConsider adding more parameters
4-5.9Needs WorkAdd email, phone parameters
0-3.9PoorMajor fixes needed

Parameters That Improve Matching:

  • em: Email (hashed)
  • ph: Phone number (hashed)
  • fn: First name (hashed)
  • ln: Last name (hashed)
  • ct: City
  • st: State
  • zp: Zip code
  • country: Country code

Common Pixel Issues & Fixes

Issue 1: Pixel Not Firing

Symptoms: No events in Events Manager

Causes:

  • Code not installed correctly
  • Ad blocker blocking pixel
  • Wrong pixel ID

Fix: Reinstall using Pixel Helper to debug

Issue 2: Duplicate Events

Symptoms: Double counting conversions

Causes:

  • Pixel + CAPI sending same event
  • Multiple pixels installed

Fix: Use event deduplication with event_id parameter

Issue 3: Missing Parameters

Symptoms: Low event match quality

Fix: Add customer data parameters to all events

Issue 4: Wrong Conversion Values

Symptoms: ROAS shows incorrectly

Fix: Ensure 'value' parameter passes actual purchase amount

Pixel & Privacy Compliance

Ensure your pixel setup complies with regulations:

GDPR (EU)

  • Obtain consent before pixel fires
  • Use Consent Mode or similar
  • Provide opt-out option

CCPA (California)

  • Honor "Do Not Sell" requests
  • Include privacy policy link

Testing Your Pixel Setup

Run these tests monthly:

TestHowExpected Result
PageView firingVisit any pageEvent appears in Events Manager
Purchase trackingComplete test purchaseValue matches purchase amount
Event deduplicationCheck for duplicatesEach event counted once
Match qualityCheck EMQ scoreAbove 6

Pixel Checklist

  • ✅ Pixel installed on all pages
  • ✅ Standard events set up (ViewContent, AddToCart, Purchase)
  • ✅ Conversions API connected
  • ✅ Event match quality above 6
  • ✅ Parameters passing (value, currency, content_ids)
  • ✅ Test purchase verified
  • ✅ Privacy compliance configured

Frequently Asked Questions

What is the Facebook Pixel?

The Facebook Pixel (now called Meta Pixel) is a piece of JavaScript code you place on your website. It tracks visitor actions like page views, add-to-carts, and purchases, then sends that data back to Meta. This enables conversion tracking, audience building for retargeting, and optimization of ad delivery to people most likely to convert.

How do I install the Facebook Pixel on my website?

Go to Events Manager in Meta Business Suite, create a new pixel, and copy the base code. Paste it in your website's <head> section on every page. For Shopify, go to Settings > Customer Events and add your Pixel ID. For WordPress, use a plugin like PixelYourSite. Verify installation using the Meta Pixel Helper Chrome extension.

What events should I track with the Facebook Pixel?

Track the key conversion events for your business: PageView (automatic), ViewContent (product pages), AddToCart, InitiateCheckout, and Purchase. For lead generation, track Lead and CompleteRegistration. Set up standard events rather than custom events when possible, as Meta's algorithm is optimized to understand standard event signals.

What is the difference between Facebook Pixel and Conversions API?

The Pixel tracks from the browser (client-side) while Conversions API (CAPI) sends data from your server (server-side). CAPI is more reliable because it bypasses ad blockers and iOS tracking restrictions. For best results, use both together with deduplication enabled — this gives Meta the most complete conversion data for optimization.

How do I verify my Facebook Pixel is working?

Install the Meta Pixel Helper Chrome extension and visit your website — it shows which events are firing. In Events Manager, check the Diagnostics tab for errors. Use the Test Events tool to verify events fire in real-time. Ensure you see a green status next to each event, and that Purchase events include value and currency parameters.

Ready to get started?

Try AdLibrary Free