- Paste the Meta Pixel base code between your site's head tags on every page for the most reliable install.
- A global header template lets you add the Pixel once for full site-wide coverage.
- The Pixel fires a PageView event automatically on every page load. No extra code needed.
- Verify the install with the free Pixel Helper Chrome extension before running any ads.
- Three conversion tracking options: standard events, custom events, and URL-based custom conversions.
- Custom conversions flagging health or financial status will be restricted by Meta starting September 2025.
Why Install the Meta Pixel
The Meta Pixel turns your website into a live data feed for your ad campaigns. One JavaScript snippet unlocks conversion measurement, audience building, and retargeting from a single install.
Automatic tracking of visitor activity
The Pixel collects page views, button clicks, and HTTP header data on every visit. You see exactly what people do on your site after clicking an ad. No extra setup required for basic activity tracking.
Conversion measurement for ROI
Tracked conversions appear directly in Ads Manager. You can tie every purchase, sign-up, or form fill to the campaign that drove it. That connection is what makes optimization possible.
Custom audience building for retargeting
The Pixel records which visitors came to your site, which pages they viewed, and which actions they took. You can retarget those visitors later. You can also build lookalike audiences from your highest-value customers.
---
Prerequisites Before Installation
Get three things ready before touching any code.
Access to your website code
You need to edit your site's HTML or template files. If you use a CMS like WordPress, Shopify, or Squarespace, look for a theme header template or a site-wide header injection field in your platform settings.
Facebook Ads Manager account
Go to business.facebook.com and confirm your account is active. You need at least admin-level access to the Business Manager to create and manage a Pixel.
Pixel ID from Events Manager
Open Events Manager inside Ads Manager. Create a new data source if you haven't already and select Web. Give the Pixel a name, enter your website URL, and copy your Pixel ID. You'll need it in the next step.
---
Install the Pixel Base Code (Recommended Method)
This is the fastest and most reliable path. Per Meta's developer documentation, placing the base code in the `
` section reduces the chance of the script being blocked and ensures it fires before a visitor leaves the page.Get your Pixel base code
- Open Events Manager in Ads Manager.
- Select your Pixel, then click Set up.
- Choose Install code manually.
- Copy the full base code snippet Meta provides.
Add code between `` tags on every page
Paste the snippet between the opening `
` and closing `` tags. Do this on every page. Not just the homepage. Every landing page, product page, and thank-you page needs the code.```html
```
Place in persistent header for site-wide coverage
Most site builders and CMS platforms have a global header template. Paste the Pixel code there once and it loads on every page automatically. No need to edit individual pages. This is the fastest way to get full site-wide coverage without repetitive copy-pasting.
Verify installation with Pixel Helper
Install the Meta Pixel Helper Chrome extension. Visit your site. The extension icon turns green if the Pixel fires correctly. Red or grey means something is wrong and needs fixing before you run ads.
---
Alternative Installation Methods
Direct code placement is best. Two alternatives exist for situations where you cannot touch the source HTML directly.
Using a tag manager (GTM, Adobe Launch, etc.)
Google Tag Manager and Adobe Launch both support the Meta Pixel. Add a new tag, choose the Meta Pixel template, and enter your Pixel ID. Meta's documentation notes that tag managers are supported but flags direct code installation as more reliable. If your team already uses a tag manager for all third-party scripts, this approach is perfectly workable.
IMG tag method (lightweight, limited)
An IMG tag version of the Pixel exists for non-JavaScript environments. Meta's documentation flags it as a limited fallback only. It cannot fire more than once per page load, cannot track button-click events, and is subject to HTTP GET character limits. Use it only if JavaScript is not available on your site.
---
Verify Your Pixel Is Working
Never skip verification. A silent Pixel failure means wasted ad spend and no audience data.
Check Events Manager for PageView events
The Pixel base code fires a `PageView` event automatically on every page load. Open Events Manager and look for recent PageView activity after visiting your site. If you see it, the Pixel is live and reporting.
Use Pixel Helper Chrome extension
Open the extension panel while browsing your site. It shows which events fired, which Pixel ID is active, and flags configuration errors with plain-language descriptions. A green checkmark means your setup is healthy.
Wait a few minutes for data to sync
Events Manager can take a few minutes to display fresh data. If you don't see activity immediately after visiting your site, wait five minutes and refresh the Events Manager page.
---
Next Steps: Set Up Conversion Tracking
PageView data is just the beginning. Conversion tracking is what connects your ad spend to real business results.
Track standard events (Purchase, ViewContent, etc.)
Meta defines a library of standard events including `Purchase`, `ViewContent`, `AddToCart`, `Lead`, and `CompleteRegistration`. Add the event code to the relevant pages. For example, place the `Purchase` event on your order confirmation page. Standard events plug directly into campaign optimization and bidding strategies.
Define custom events for unique actions
Not every business fits the standard event library. You can define custom events for any action you care about, such as a video play, a scroll depth milestone, or a specific button click. Add the `fbq('trackCustom', 'YourEventName')` call wherever the action occurs in your page code.
Create custom conversions for URL patterns
Custom conversions track events automatically by matching URL patterns. No additional code required. In Events Manager, navigate to Custom Conversions, define a URL rule, and Meta marks matching visits as conversions. This is the easiest option for thank-you pages and confirmation URLs.
One compliance note. Starting September 2, 2025, Meta will restrict custom conversions that suggest health conditions or financial status. Review any existing custom conversions now and update them before that date to avoid campaign disruption.
---
Or let Coinis do it.
From a product URL to a live Meta campaign. AI-generated creatives. On-brand copy. Direct publish to Facebook and Instagram. Real performance reporting. All in one platform.
Start free. Upgrade when you're ready.
15 AI tokens a month. No credit card.
Frequently Asked Questions
Where exactly do I paste the Meta Pixel code?
Paste it between the opening <head> and closing </head> tags on every page of your site. Most CMS platforms have a global header template where you can add it once for full site coverage.
How do I know if my Pixel is installed correctly?
Install the free Meta Pixel Helper Chrome extension. Visit your site. If the icon turns green and shows a PageView event, your Pixel is firing correctly. You can also check Events Manager in Ads Manager for live PageView data.
Can I use Google Tag Manager to install the Meta Pixel?
Yes. Tag managers like Google Tag Manager and Adobe Launch are supported by Meta. Add a new Meta Pixel tag, enter your Pixel ID, and publish. Meta recommends direct code installation as more reliable, but GTM works well for most setups.
What is the difference between standard events, custom events, and custom conversions?
Standard events are predefined actions like Purchase or Lead that integrate directly with campaign optimization. Custom events are actions you define yourself by adding a tracking call to your code. Custom conversions track events automatically based on URL patterns with no extra code needed.