If you run ads on Facebook or Instagram without a working pixel, you are essentially paying Meta to guess who your customers are. The pixel is what lets you track conversions, build retargeting audiences and feed the algorithm the signals it needs to optimise your campaigns.
This guide covers how to set up Facebook Pixel (officially called the Meta Pixel) from scratch: creating it in Meta Events Manager, installing it manually, on WordPress, on Shopify and through Google Tag Manager, then verifying it with the Meta Pixel Helper. And because installation is rarely the hard part, the second half of this article is a full troubleshooting section for the most common problem people run into: a pixel that shows no activity after install.
Quick answer: set up the Meta Pixel in 6 steps
- Go to Meta Events Manager inside your Business Manager account.
- Click Connect data sources and select Web.
- Name your pixel (dataset) and enter your website URL, then click Create.
- Choose your install method: partner integration, manual code, or Google Tag Manager.
- Place the base code in the
<head>of every page, then add standard events on key pages. - Verify with the Meta Pixel Helper Chrome extension and the Test Events tab.
Expect 10 to 15 minutes for a plugin or app install, and 30 to 45 minutes for a manual setup with custom events.

What the Meta Pixel actually is in 2026
The Meta Pixel is a short snippet of JavaScript you place on your website. When someone visits a page or performs an action such as adding to cart, the pixel sends an event to Meta, matched (where possible) to a Facebook or Instagram user.
Two naming details trip people up:
- Facebook Pixel is now the Meta Pixel. Same tool, renamed. The old
fbqfunction and the pixel ID format have not changed. - In Events Manager, pixels now live inside “datasets”. A dataset groups your website pixel and your Conversions API server events under one ID, so the interface may say “dataset ID” where older tutorials say “pixel ID”. They are the same number.
What a correctly installed pixel gives you:
- Conversion tracking and accurate cost per result
- Retargeting audiences (site visitors, product viewers, cart abandoners)
- Lookalike audiences built from real buyers
- Conversion optimisation, so delivery targets people likely to convert
- Dynamic product ads for ecommerce catalogues
Before you start: prerequisites checklist
| What you need | Why it matters |
|---|---|
| A Meta Business Manager account | Pixels created from a personal ad account are painful to share later |
| Admin access to your website | You need to edit the theme header or install a plugin/app |
| Meta Pixel Helper (Chrome extension) | The fastest way to confirm the pixel fires |
| Access to your cookie consent tool | Consent settings are the number one cause of “no activity” |
| Domain verification rights (DNS or file upload) | Required for Aggregated Event Measurement and event prioritisation |
Step 1: Create your pixel in Meta Events Manager
- Open Meta Events Manager (business.facebook.com/events_manager).
- In the left menu, click Connect data sources, then select Web and click Connect.
- Enter a clear name. Use something like BrandName – Main Site rather than “Pixel 1”. Renaming later is possible but confusing across accounts.
- Enter your website URL. Meta will check for an available partner integration.
- Click Create. Your pixel ID (a 15 or 16 digit number) appears at the top of the dataset page. Copy it somewhere safe.
One pixel or several?
In almost every case, use one pixel per website, not one per ad account or per campaign. A single pixel accumulates more data, which improves audience size and optimisation. Use separate pixels only when you run genuinely separate brands or domains that should never share audiences.

Step 2: Choose your installation method
| Method | Best for | Difficulty | Event tracking |
|---|---|---|---|
| Partner integration (Shopify, WooCommerce, Wix, Squarespace, HubSpot) | Most ecommerce and CMS sites | Easy | Automatic standard events |
| Manual code install | Custom builds, full control | Medium | Manual, fully customisable |
| Google Tag Manager | Sites already using GTM | Medium | Trigger based, very flexible |
| Conversions API (server side) | Everyone, as a complement | Advanced | Server events, resistant to blockers |
Our recommendation: browser pixel plus Conversions API. Browser only setups now lose a meaningful share of events to ad blockers, tracking prevention in Safari and Firefox, and consent refusals.
Step 3A: Manual code installation
In your dataset, go to Settings or the setup flow, choose Install code manually, and copy the base code. It looks like this:
<!-- 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 -->
Rules for placement:
- Paste it inside the
<head>tag, as close to the closing</head>as possible. - It must load on every page, including checkout, thank you pages and landing pages built on subdomains.
- Replace
YOUR_PIXEL_IDin both places if you copy code from elsewhere. Codes pulled from Events Manager already contain your ID. - Never install the same pixel ID twice on one page. Duplicate PageViews inflate traffic numbers and can double count conversions.
Step 3B: How to set up Facebook Pixel on WordPress
Option 1: Use a plugin (recommended for most users)
- In WordPress, go to Plugins > Add New.
- Search for a pixel plugin. Popular reliable choices include PixelYourSite, Insert Headers and Footers (WPCode), or the official Facebook for WooCommerce plugin if you run a shop.
- Click Install Now, then Activate.
- Open the plugin settings and paste your pixel ID (not the whole code block, just the number) into the Meta Pixel field.
- Save, then clear your caching plugin and any CDN cache.
WooCommerce specifics
The Facebook for WooCommerce plugin automatically fires ViewContent, AddToCart, InitiateCheckout and Purchase with product IDs and values. If you also add the pixel through a header injection plugin, you will end up with duplicate events. Pick one method only.
Option 2: Add the code to your theme
- Go to Appearance > Theme File Editor and open
header.php, or better, use a child theme. - Paste the base code just before
</head>. - Update the file.
Warning: code added directly to a parent theme is wiped on the next theme update. Use a child theme or a code snippet plugin instead.
Option 3: WPCode / header script plugin
Create a new snippet, set the location to Site Wide Header, paste the full pixel code, and activate. This survives theme updates and is easy to audit later.
Step 3C: How to set up the Meta Pixel on Shopify
Shopify no longer wants you pasting raw pixel code into theme.liquid, because checkout runs on Shopify’s own infrastructure. Use one of these two supported routes.
Route 1: Facebook & Instagram sales channel (recommended)
- In your Shopify admin, go to Apps and install the Facebook & Instagram channel if it is not already there.
- Open the channel and click Settings > Data sharing settings.
- Enable customer data sharing and choose your data sharing level: Standard, Enhanced or Maximum. Maximum enables server side sharing through the Conversions API and gives the best match quality.
- Select the pixel you created in Events Manager from the dropdown, then confirm.
- Save. Shopify will now send PageView, ViewContent, AddToCart, InitiateCheckout and Purchase automatically.
Route 2: Custom pixel in Customer Events
If you need a second pixel or custom logic:
- Go to Settings > Customer events.
- Click Add custom pixel and name it.
- Paste your pixel base code, then subscribe to Shopify’s standard events using
analytics.subscribe()to map them tofbq('track', ...)calls. - Set the customer privacy permissions, then Save and Connect.
Do not run both routes with the same pixel ID at once unless you have proper event deduplication in place.

Step 3D: Installing through Google Tag Manager
- In GTM, create a new tag of type Custom HTML.
- Paste the pixel base code including the script tags.
- Set the trigger to All Pages.
- Name it clearly, for example Meta Pixel – Base.
- Create separate Custom HTML tags for each conversion event, triggered on the relevant page or interaction. Each one only needs the
fbq('track', 'EventName');line, not the full base code again. - Use Preview mode to test, then Submit to publish.
The most common GTM mistake: forgetting to publish the container. Preview mode works, the live site shows nothing.
Step 4: Add standard events
A PageView alone will not let you optimise for conversions. You need standard events on the actions that matter. (via https://metricool.com)
| Event | When to fire it | Code |
|---|---|---|
| ViewContent | Product or key service page | fbq('track', 'ViewContent'); |
| AddToCart | Item added to basket | fbq('track', 'AddToCart'); |
| InitiateCheckout | Checkout started | fbq('track', 'InitiateCheckout'); |
| Lead | Form submitted, quote requested | fbq('track', 'Lead'); |
| CompleteRegistration | Account or trial signup | fbq('track', 'CompleteRegistration'); |
| Purchase | Order confirmation page | fbq('track', 'Purchase', {value: 49.90, currency: 'EUR'}); |
Always include value and currency on Purchase events. Without them you cannot report on ROAS or optimise for value.
Using the Event Setup Tool instead of code
If you cannot edit your site, open your dataset in Events Manager, click Add events > From the pixel > Open Event Setup Tool, enter your URL, and click buttons directly on your site to map them to events. It is slower to maintain and breaks when you redesign, but it is a valid option for non technical teams.
Step 5: Verify the pixel is firing
Method 1: Meta Pixel Helper
- Install the Meta Pixel Helper extension in Chrome or Edge.
- Visit your website in a normal (non incognito) tab with ad blockers disabled.
- Click the extension icon. A green indicator with your pixel ID and a PageView event means the base code works.
- Navigate to a product page, add to cart and complete a test order to confirm each event fires once, with the right parameters.
Method 2: Test Events in Events Manager
Go to your dataset, open the Test Events tab, paste your website URL and browse the site. Events appear in real time within a few seconds. This is the most reliable check because it shows what Meta actually received, not just what your browser sent.
Method 3: Overview and Diagnostics tabs
The Overview tab shows event volume, but data can take 20 minutes to a few hours to populate. The Diagnostics tab flags issues such as missing parameters, invalid values or redundant Purchase events. Check it weekly.

Troubleshooting: my pixel shows no activity
This is where most setups fall apart. Work through these causes in order.
1. You are looking too early
The Overview tab is not real time. If you just installed the pixel, use Test Events instead. Give the main dashboard up to a few hours before panicking.
2. Caching is serving the old page
The single most common WordPress issue. Purge in this order:
- Your caching plugin (WP Rocket, LiteSpeed, W3 Total Cache)
- Your host level cache (SiteGround, Kinsta, WP Engine and similar)
- Your CDN (Cloudflare: use Purge Everything)
- Your own browser cache, then reload with a hard refresh
3. Your cookie consent banner is blocking the script
Under GDPR setups, most consent tools block marketing scripts until the visitor accepts. If you never click “Accept” when testing, the pixel never loads and Pixel Helper reports nothing. Test by accepting cookies first. If the pixel still does not fire after consent, check that the script is correctly categorised as marketing rather than blocked outright, and that your consent tool is not stripping the tag from the DOM.
4. Ad blockers and browser tracking prevention
uBlock Origin, Brave, Safari ITP and Firefox strict mode all block connect.facebook.net. Test in a clean Chrome profile with extensions disabled. This is also the strongest argument for adding the Conversions API, which sends events server to server.
5. The code is in the wrong place
Right click your page, choose View page source and search for fbq or your pixel ID. If it is absent, the code was never saved (theme editor errors, snippet not activated, GTM container not published). If it appears inside the <body> footer or after other blocking scripts, move it into the <head>.
6. Wrong pixel ID or wrong ad account
Agencies frequently install a pixel belonging to a different Business Manager. Compare the ID shown in Pixel Helper against the ID in Events Manager, digit by digit. Also confirm the pixel is assigned to the ad account you are running campaigns from, under Business Settings > Data Sources > Pixels > Assign assets.
7. A JavaScript error is stopping execution
Open the browser console (F12) and look for red errors. A syntax error from another script higher in the head can prevent the pixel from initialising. Also check that the snippet was not mangled by a text editor converting straight quotes into curly quotes.
8. The pixel is only on the homepage
Check a product page, a blog article and the checkout separately. Single page apps built in React, Vue or Next.js often fire PageView only on the first load, so route changes are never tracked. Fire fbq('track', 'PageView') manually on route change.
9. Checkout runs on a different domain
Payment providers, booking engines and third party checkouts break tracking. Either install the pixel on the checkout domain too, or use the Conversions API to send the purchase from your server.
10. Domain not verified
Events can be received but attribution restricted if your domain is unverified. Go to Business Settings > Brand Safety > Domains and verify via DNS TXT record, HTML file upload or meta tag, then configure your prioritised events in Aggregated Event Measurement.
Diagnostic reference table
| Symptom | Likely cause | Fix |
|---|---|---|
| Pixel Helper finds no pixel | Code missing, cached page, or consent blocking | View source, purge cache, accept cookies |
| Pixel found but no events received | Ad blocker or network blocking the request | Test in clean profile, add Conversions API |
| Duplicate PageView warning | Pixel installed twice (plugin + theme, or app + GTM) | Remove one instance |
| Purchase events with no value | Missing value and currency parameters | Add both to the Purchase call |
| Events in Test Events but not Overview | Normal reporting delay | Wait a few hours |
| Conversions tracked but not attributed to ads | Pixel not assigned to ad account, or domain unverified | Assign asset, verify domain, set AEM priorities |
| Purchase counted twice | Browser and server events not deduplicated | Send matching event_id and event_name on both |
Go further: add the Conversions API
In 2026, a browser only pixel typically misses a significant portion of conversions. Pairing the pixel with the Conversions API (CAPI) recovers much of that loss.
- Shopify: set data sharing to Maximum in the Facebook & Instagram channel.
- WooCommerce: the official Facebook for WooCommerce plugin includes CAPI support.
- Other platforms: use a Conversions API Gateway, a partner integration such as Stape or Zapier, or a direct server side implementation.
Deduplication is essential: send the same event_id and event_name from both the browser and the server so Meta counts a single conversion.
Improve your event match quality score
In Events Manager, each event gets a match quality score. Raise it by passing hashed customer parameters where you legally can: email, phone, first and last name, city, postcode, country and external ID. A score above 6.0 is decent, above 8.0 is strong.
Post install checklist
- Base code present in the head of every page
- Only one instance of your pixel ID per page
- PageView firing site wide
- Key standard events firing with value and currency
- Purchase confirmed on a real test order
- Domain verified in Business Settings
- Pixel assigned to the correct ad account
- Conversions API connected and deduplicated
- Aggregated Event Measurement priorities configured
- Diagnostics tab clear of warnings
FAQ
Is a Facebook pixel necessary?
If you spend money on Meta ads, yes. Without it you cannot track conversions, retarget visitors, build lookalike audiences or optimise for anything beyond clicks. Even if you are not advertising yet, install it now so you accumulate audience data for later.
What is the Facebook pixel called now?
It is called the Meta Pixel. Inside Events Manager it sits within a “dataset”, which combines your web pixel and Conversions API events under a single ID.
How do I make sure my Facebook pixel is working?
Use the Meta Pixel Helper browser extension for an instant check, then confirm in the Test Events tab of Events Manager that Meta is actually receiving the events. Finally, review the Diagnostics tab for parameter warnings.
Where can I find my pixel ID?
Open Meta Events Manager, select your dataset, and the ID appears under the name at the top of the page. It is also visible in Business Settings > Data Sources > Datasets.
Can I use the same pixel on multiple websites?
Technically yes, but it is not recommended. Traffic from different domains mixes into the same audiences, which makes segmentation and reporting messy. Use one pixel per website and share data at the ad account level instead. Anyone digging further should read How to install a Facebook Pixel.
How long does it take for pixel data to appear?
Test Events show within seconds. The Overview dashboard can take 20 minutes to several hours. Custom audiences typically need 24 to 48 hours and a minimum audience size before they become usable in campaigns.
Does the pixel still work without cookies?
Partially. First party cookies still work in most browsers, but Safari and Firefox restrict their lifespan, and users who refuse consent are not tracked at all. This is why server side tracking through the Conversions API has become standard practice.
Do I need to install the pixel if I use Shopify?
You still create the pixel in Events Manager, but you connect it through the Facebook & Instagram sales channel rather than pasting code into your theme. Shopify then handles the standard events for you.
Final word
Setting up the Meta Pixel takes minutes. Making sure it reports clean, deduplicated, well matched data is what separates campaigns that scale from campaigns that stall. Install it properly, verify every event with the Pixel Helper and Test Events, then layer the Conversions API on top.
Need help auditing a tracking setup that is not reporting correctly? The team at King Content Agency can review your pixel, events and attribution configuration and get your data flowing again.
