Installing Facebook Pixel (now officially called Meta Pixel) on your website enables conversion tracking, audience building, and ad optimization for your Facebook and Instagram campaigns. The installation process varies depending on your website platform, but the core idea is always the same: a small piece of JavaScript code gets added to every page of your site, and it sends data to Meta whenever someone takes an action on your site.
This guide covers the complete installation process — from finding your Pixel ID to verifying that events are firing correctly — for both manual (code-based) installation and platform integrations.
Why It Matters
The Meta Pixel is the foundation of performance advertising on Facebook and Instagram. Without it, your ads campaign with minimal feedback — you can see clicks and impressions, but not what happened after the click. With the Pixel installed and events configured, Meta can optimize delivery to show your ads to the people most likely to convert, you can retarget visitors who did not convert the first time, and you can accurately measure return on ad spend (ROAS) down to individual campaigns and creatives.
For e-commerce businesses, the Pixel is particularly critical. Tracking add-to-cart events, checkout starts, and purchases gives you the data needed to run conversion-optimized campaigns and dynamic product ads — two of the most effective ad types available on Meta's platforms.
What You Need Before You Start
A Meta Business Manager account with an ad account. Access to your website's code (for manual installation) or admin access to your website's platform (for plugin or integration-based installation). A browser with the ability to install Chrome extensions, for verification purposes. If your website uses Google Tag Manager, that is an alternative installation path — you will need admin access to your GTM container.
Step-by-Step Guide
Step 1: Go to Events Manager
Log into Meta Business Manager at business.facebook.com. Click the grid menu icon (top left) and select Events Manager, or go directly to business.facebook.com/events_manager.
Step 2: Create a New Pixel
Click the green + Connect a data source button. Select Web as the data source type. Click Get started. On the next screen, click Meta Pixel and then Connect. Enter a name for the Pixel and your website URL. Click Continue.
Step 3: Find Your Pixel ID
After creating the Pixel, you will see a setup screen with your Pixel details. Your Pixel ID is the 15–16 digit number shown in the Events Manager next to your Pixel's name. Copy and save this number — you will need it for platform-based installations.
Step 4A: Install on WordPress
If your site uses WordPress, the easiest installation method is via a plugin. Meta maintains an official plugin called Meta for WordPress (also labeled as Facebook for WordPress or Pixel Caffeine in older versions). Install it from your WordPress admin → Plugins → Add new, search for "Meta for WordPress", install and activate it. Once active, connect it to your Facebook account, select your Business Manager and Pixel, and save. The plugin handles all the code insertion automatically.
Step 4B: Install on Shopify
In your Shopify admin, go to Marketing → Facebook (or via the Sales Channels → Facebook & Instagram section). Follow the prompts to connect your Meta Business Manager. When asked about the Pixel, enter your Pixel ID or select it from your Business Manager. Shopify will automatically add the Pixel code to your storefront and configure standard e-commerce events (ViewContent, AddToCart, Purchase, etc.).
Step 4C: Install on Wix
Log into your Wix dashboard and go to Marketing Tools → Facebook Pixel. Click Connect and enter your Pixel ID. Wix will add the Pixel to all pages automatically.
Step 4D: Manual Installation (Custom Site or Any CMS)
In Events Manager, choose Install code manually. You will see a code block — this is your base Pixel code. It looks like a snippet of JavaScript that includes your unique Pixel ID.
Copy the entire code block. Open your website's theme or template files and find the global <head> section — this is the section that appears on every page of your site (often in a file called header.php, head.html, or similar). Paste the Pixel code just above the closing </head> tag. Save and publish your changes.
To verify the code is in the right place, go to your website in a browser, right-click anywhere, and select View Page Source. Search (Ctrl+F or Cmd+F) for your Pixel ID in the source code. If you find it in the <head> section, the code is correctly placed.
Step 4E: Install via Google Tag Manager
If your site uses GTM, you can install the Pixel as a tag. In your GTM workspace, click New Tag → Tag Configuration → Custom HTML. Paste the Pixel code in the HTML field. Set the trigger to All Pages. Save and publish the container.
Step 5: Add Standard Events
The base Pixel tracks page views automatically. To track other actions, you need to add event code. The most important standard events for most businesses:
For page-level events (track when a certain page is viewed, such as a "thank you" or "order confirmation" page):
Add the event code on that specific page. For example, to track a purchase from an order confirmation page, add fbq('track', 'Purchase', {value: 99.99, currency: 'USD'}); to that page.
For button/action events (track when someone clicks a button):
Add the event code to the button's onclick handler. For example: onclick="fbq('track', 'Lead')" on a form submit button.
Step 6: Use the Event Setup Tool for No-Code Event Setup
For non-developers: in Events Manager, select your Pixel → Open event setup tool. Enter your website URL. Meta will launch your website with an overlay interface. You can click on any button, link, or URL on your site to set up events without writing code. This is especially useful for setting up Lead or ViewContent events on specific pages.
Step 7: Install Meta Pixel Helper and Verify
In Google Chrome, install the Meta Pixel Helper extension from the Chrome Web Store. After installation, visit your website and click the extension icon in your browser toolbar. If the Pixel is installed correctly, the extension will show your Pixel ID with a green checkmark. Browse through different pages and take actions (add something to cart, fill out a form) to check that events are firing.
Step 8: Use Test Events in Events Manager
Go back to Events Manager, select your Pixel, and click the Test events tab. Enter your website URL and click Open website. Events Manager will show real-time events as they fire from your site, confirming the exact data being sent to Meta. This is the most reliable way to verify your setup before running campaigns.
Common Issues and How to Fix Them
The Pixel Helper shows multiple pixels firing. If more than one Pixel is detected, you have duplicate code installed — possibly from a plugin AND manual installation. Remove the duplicate. Multiple pixels firing the same events can inflate your conversion data.
Events are firing but with missing or incorrect parameters. For e-commerce events like Purchase, Meta expects specific parameters like value and currency. If these are missing, conversions will be tracked but revenue data will not. Work with a developer to ensure event parameters are being passed correctly.
The Pixel is installed but showing as inactive in Events Manager. Visit your website in a browser while logged in to the internet. A single page view should activate the Pixel. If it is still inactive after a genuine website visit, check the Pixel Helper for errors.
My website's cookie banner is blocking the Pixel. This is correct behavior if you have a consent management platform. The Pixel should only fire after the user consents to marketing cookies. Ensure your consent platform is configured to load the Meta Pixel only after consent is given.
Tips to Get the Most Out of Your Pixel Installation
Install the Pixel before you need it. Pixel data takes time to accumulate. Custom audiences built from Pixel data need to reach a minimum size before they can be used. Install the Pixel as early as possible — even months before you plan to run ads — so the data is ready when you need it.
Track as many events as possible. More event data gives Meta more signals to optimize your campaigns. Even if you are not using all events for optimization right now, having the data collected means you can use it in the future without having to go back and set things up again.
Implement the Conversions API. Browser-based pixel data is increasingly incomplete due to ad blockers and ITP (Intelligent Tracking Prevention) in browsers like Safari. The Conversions API sends event data directly from your server, complementing the browser-based pixel. Together, they give you the most complete conversion data possible.
Frequently Asked Questions
What is the difference between the Meta Pixel and the Conversions API?
The Meta Pixel is a browser-based tracking script — it fires from the user's browser. The Conversions API is a server-side solution — it sends events directly from your server to Meta, bypassing browser limitations. They track similar data but through different channels. Using both provides the most accurate and complete data.
Does every page of my website need the Pixel code?
Yes. The base Pixel code should be on every page so Meta can track all visitor behavior. Event codes (for specific actions) are typically only needed on relevant pages or elements — for example, the purchase event only needs to be on the order confirmation page.
How do I find my Pixel ID?
Your Pixel ID is displayed in Events Manager (business.facebook.com/events_manager). Select your Pixel from the left panel and you will see the ID displayed near the top. It is a 15–16 digit number.
Can I use one Meta Pixel for multiple websites?
You can, but it is not recommended for unrelated websites because the data from different sites gets mixed together in a single pixel's dataset. Use separate pixels for separate websites to keep your data clean and audiences well-defined.