Performance Optimization13 min read

Meta Ads Setup Series (Part 4 of 5): How to Set Up the Meta Pixel and Connect It to Your Website

Wissam Hallak

Wissam Hallak

Feb 18, 2026
Share
Meta Ads Setup Series (Part 4 of 5): How to Set Up the Meta Pixel and Connect It to Your Website

What Is the Meta Pixel and Why Do You Need It?

The Meta Pixel (formerly the Facebook Pixel) is a small piece of JavaScript code you place on your website. When someone visits your site after clicking an ad, the pixel fires and tracks their actions: pages they view, products they browse, items they add to cart, and purchases they complete.

This data powers three critical functions:

  1. Conversion tracking: See exactly which ads led to real sales, sign-ups, or leads, not just clicks.
  2. Audience building: Create Custom Audiences from website visitors for retargeting, and build Lookalike Audiences to find similar potential customers.
  3. Ad optimization: Meta uses pixel data to automatically show your ads to people most likely to take the action you care about.

Without the pixel, you are flying blind: spending money on ads with no way to measure what is actually working. If you are running Meta ads, the pixel is not optional. It is essential.

When you open Events Manager, you will see a dashboard displaying your data sources, connected pixels, and a real-time feed of events firing from your website. This is where you will monitor all your pixel activity.

Drowning in Meta Ads?

Drowning in Meta Ads?

Put your campaign on autopilot with Nova.

Read more

Step 1: Create Your Meta Pixel in Events Manager

Before you can install anything, you need to create your pixel inside Meta's system.

  1. Log in to Meta Business Suite at business.facebook.com.
  2. Navigate to All Tools > Events Manager.
  3. Click Connect Data Sources.
  4. Select Web, then click Connect.
  5. Choose Meta Pixel, then click Connect.
  6. Give your pixel a name. Use something descriptive like "YourBrand Website Pixel" so it is easy to identify later.
  7. Optionally enter your website URL so Meta can check for easy integration options.
  8. Click Create Pixel.

Once created, you will see your Pixel ID: a long number you will need during installation. Copy it and keep it handy.

Important: You get one pixel per ad account by default. If you manage multiple websites under the same ad account, use the same pixel and distinguish traffic with custom events or parameters.

In Events Manager, the Connect Data Sources flow will guide you through linking your pixel to your website. You will see options for Web, App, and Offline data sources. Select Web and follow the prompts to set up your pixel.

Step 2: Install the Pixel on Your Website

There are two main approaches depending on your platform.

Option A: Manual Code Installation

This works for any website where you can edit the HTML.

  1. In Events Manager, click Continue Pixel Setup, then select Install Code Manually.
  2. Copy the base pixel code. It starts with a script tag containing fbq('init', 'YOUR_PIXEL_ID') followed by fbq('track', 'PageView').
  3. Paste this code into the <head> section of every page on your site, right before the closing </head> tag.
  4. The code must go in the <head>, not the <body>. Placing it in the head ensures it loads before any page content, so no visits get missed.

Option B: Partner Integrations

If your site runs on a major platform, Meta has built-in integrations that handle the technical setup for you.

In the Events Manager setup flow, you will see a list of Partner Integrations for platforms like Shopify, WordPress, WooCommerce, Squarespace, and others. Select your platform and follow the step-by-step instructions to connect your pixel.

Pixel or dataset?

Meta now calls the Pixel a dataset inside Events Manager. If a screen says dataset where older guides say Pixel, they are the same thing, and the dataset ID works anywhere the old Pixel ID did. Whichever platform you use, connect the pixel one way only. A native integration or plugin should replace any manually pasted base code, or you can end up double-counting PageView and purchase events.

Install the Meta Pixel on Shopify

Shopify connects through the built-in Facebook and Instagram by Meta sales channel, so a standard store needs no manual code. The same channel can send server-side events through the Conversions API using Shopify's data-sharing settings.

Connect the Meta Pixel on Shopify

1
Open the app store

In your Shopify admin, go to Settings, then Sales channels, then Shopify App Store.

2
Add the Meta channel

Search for Facebook and Instagram by Meta and click Add channel.

3
Connect your account

Click Start setup, then Connect account, and sign in to Facebook.

4
Link your assets

Connect the Meta business portfolio, ad account, Page, and catalog you want to use.

5
Choose the pixel and data sharing

Select an existing pixel or dataset, or create one, then pick a customer data-sharing level: Standard, Enhanced, or Maximum.

6
Do not double-install

Leave the channel as the only pixel install. Do not also paste base code into theme.liquid, or events will be counted twice.

Install the Meta Pixel on WordPress

WordPress uses the official plugin published by Facebook. One naming quirk to know: the plugin is now listed as Meta pixel for WordPress, but you may still search for Facebook for WordPress to find it.

Connect the Meta Pixel on WordPress

1
Open the plugin browser

In the WordPress dashboard, go to Plugins, then Add New.

2
Find the plugin

Search for Facebook for WordPress, select Meta pixel for WordPress authored by Facebook, and click Install Now, then Activate.

3
Start setup

Open the plugin settings page and click Get Started.

4
Connect to Meta

Complete the Facebook Business Extension flow, sign in to Meta, and select your business assets.

5
Approve access

Approve the access token so the plugin can inject the pixel across your whole site.

6
Manual fallback

If you cannot use the plugin, copy the base code from Events Manager and place it in the site-wide head through a header or snippet plugin instead.

Install the Meta Pixel on Wix

Wix has a native Meta Pixel and CAPI integration that sends both browser and server-side events, so you do not paste any base code. It is the recommended route for Wix Stores.

Connect the Meta Pixel on Wix

1
Open your dashboard

Open your Wix site dashboard.

2
Go to integrations

Go to Marketing and SEO, then Marketing Integrations.

3
Connect Meta

Find Meta Pixel and CAPI and click Connect, then Connect to Facebook and sign in.

4
Approve permissions

Click Next through the permissions screens for Wix marketing tools.

5
Select your pixel

Select the Meta business account and pixel or dataset, then click Done.

Install the Meta Pixel on Squarespace

Squarespace has a built-in Meta Pixel and Ads panel where you paste only the pixel ID, not the full base code. It accepts one pixel ID. If you added pixel code manually before, remove it first so tracking is not duplicated.

Connect the Meta Pixel on Squarespace

1
Open your dashboard

Log in to your Squarespace site dashboard.

2
Open the Meta panel

Go to Settings, then Marketing, then Meta Pixel and Ads.

3
Paste your pixel ID

Copy your pixel ID from Meta Events Manager, paste it into the Pixel ID field, and click Save.

4
Clean up old code

If you used manual pixel code before, remove it from Settings, Advanced, Code Injection, checking the Header and Order Confirmation Page fields.

5
Note on CAPI

This panel installs the pixel ID only. The Conversions API is a separate setup and is not switched on automatically here.

Install the Meta Pixel with Google Tag Manager

Google Tag Manager is not a site platform on its own, so your site must already have the GTM container installed. Meta's official method is a Custom HTML tag.

Connect the Meta Pixel with Google Tag Manager

1
Copy the base code

In Meta Events Manager, go to Data sources, select your dataset, click Add events, Add new integration, then Meta Pixel, Set up, choose Manually add code, and copy the base code.

2
Create a tag

In Google Tag Manager, open your web container and go to Tags, then New.

3
Paste as Custom HTML

Choose Custom HTML, name the tag (for example Meta Pixel base code), and paste Meta's base code.

4
Set firing and trigger

Under Advanced settings, set firing to Once per page, then add the All Pages trigger.

5
Test and publish

Save the tag, use Preview to test that it fires, then submit and publish the container.

6
Add event tags

For each conversion, add another Custom HTML tag with the event code, such as fbq('track', 'Purchase', {...}), and attach a matching page or click trigger.

Before you launch

Whatever method you use, confirm PageView fires once, the correct dataset ID is in place, and key events like Lead, AddToCart, and Purchase carry the right value and currency. Check Events Manager Test Events and run the Meta Pixel Helper on your live site before you spend on ads.

Step 3: Set Up Standard Events

The base pixel code only tracks PageView (someone landed on your site). To track meaningful actions, you need to add standard events.

Here are the most common standard events:

  • PageView: Fires on every page load. Already included in the base code.
  • ViewContent: Fires when someone views a specific product or content page.
  • AddToCart: Fires when someone adds an item to their shopping cart.
  • InitiateCheckout: Fires when someone begins the checkout process.
  • Purchase: Fires when a transaction is completed. This is the most important conversion event for ecommerce.
  • Lead: Fires when someone submits a form or expresses interest (great for service businesses).
  • CompleteRegistration: Fires when someone completes a registration or account creation.
  • Search: Fires when someone uses your site search.

How to add events manually: Place an additional fbq('track', 'EventName') call on the relevant page or after the relevant action. For example, on your order confirmation page, add fbq('track', 'Purchase', {value: 29.99, currency: 'USD'}).

If you are using a partner integration (Shopify, WordPress plugin, etc.), many of these events are configured automatically through the platform's settings.

You can also use the Meta Event Setup Tool: a visual, no-code tool inside Events Manager that lets you point and click on elements of your website to assign events without writing any code.

Pro tip: At minimum, set up PageView, ViewContent, AddToCart, and Purchase. These four events give Meta enough data to optimize your campaigns effectively.

The Event Setup Tool opens as an overlay on your website. You will see your site with a toolbar at the top, allowing you to click on buttons, links, and page elements to assign events to them. Select an element, choose the event type (such as Add to Cart or Purchase), and confirm.

Step 4: Test Your Pixel with Meta Pixel Helper

Before you launch any campaigns, verify that your pixel is working correctly.

Install the Meta Pixel Helper Chrome extension:

  1. Go to the Chrome Web Store and search for "Meta Pixel Helper."
  2. Install the extension.
  3. Navigate to your website.
  4. Click the Pixel Helper icon in your Chrome toolbar.
  5. Look for a green checkmark and your Pixel ID. It should show which events are firing on that page.

Also use the Test Events tool in Events Manager:

Go to Events Manager > Your Pixel > Test Events. Enter your website URL and browse your site. Events will appear in real time as they fire, confirming everything is connected.

Common issues to watch for:

  • No pixel found: Double-check that the code is in the <head> section, not the <body>.
  • Events not firing: Make sure the event code is placed on the correct page and that it runs after the page loads.
  • Duplicate events: If you see the same event firing twice, you may have the pixel code installed in two places (for example, both manually and through a plugin).

The Meta Pixel Helper extension appears as a small icon in your Chrome toolbar. When you visit your website, click the icon to see a popup listing all pixel events detected on the current page, including the event name, parameters sent, and whether the event fired successfully.

Step 5: Set Up the Conversions API for Server-Side Tracking

The Conversions API (CAPI) sends event data directly from your server to Meta, bypassing the browser entirely. This is increasingly important as browsers block third-party cookies and tracking scripts.

CAPI is not a replacement for the pixel. It is a complement. Running both together gives Meta the most complete picture of your customer journey.

Platform-specific setup:

Shopify: If you already connected the Facebook & Instagram sales channel, enabling CAPI is simple. It is built into the channel settings. Toggle it on and Shopify handles the server-side event sending automatically.

WordPress: Use PixelYourSite Pro or the official Meta plugin. Both support CAPI configuration through their settings panels.

Custom websites: You will need developer help to send events via the Meta Marketing API. Meta provides detailed documentation and SDKs for server-side implementation.

Gateway setup: Meta also offers the Conversions API Gateway, a cloud-based solution you can deploy through AWS or Google Cloud. It acts as a middleman between your server and Meta, simplifying the integration.

Prioritize setting it up. It is becoming increasingly important as browser-based tracking becomes less reliable.

In Events Manager, you can view your event activity and see which events come from the browser-side Pixel and which come from the server-side Conversions API. Look for the Connection Method column to confirm both sources are sending data.

Step 6: Verify Your Domain

Domain verification confirms to Meta that you own the website where your pixel is installed. This is required for editing link previews and for Aggregated Event Measurement (Apple's iOS privacy changes).

  1. Go to Business Settings > Brand Safety > Domains.
  2. Click Add and enter your root domain (for example, yourbrand.com, without www or https).
  3. Choose one of three verification methods:
  • DNS TXT record (recommended): Add a TXT record to your domain's DNS settings. This is the most reliable method.
  • HTML file upload: Download a verification file from Meta and upload it to your website's root directory.
  • Meta tag: Add a meta tag to the <head> section of your homepage.

DNS verification is the most reliable. Log in to your domain registrar (GoDaddy, Namecheap, Cloudflare, etc.), navigate to DNS settings, and add the TXT record Meta provides.

After verification: Go to Events Manager > Aggregated Event Measurement and configure your priority events. You can rank up to 8 conversion events per domain. Put your most important events (like Purchase) at the top.

To verify your domain, navigate to Business Settings > Brand Safety > Domains. Click Add to enter your domain, then choose one of the three verification methods. Once verified, you will see a green checkmark next to your domain name.

Your Pixel Setup Checklist

Before moving on, confirm you have completed each step:

  • Created your Meta Pixel in Events Manager
  • Installed the pixel code on your website (manual or partner integration)
  • Added standard events for key conversion actions
  • Tested with Meta Pixel Helper and the Test Events tool
  • Set up the Conversions API for server-side tracking
  • Verified your domain and configured Aggregated Event Measurement

With all six steps complete, your tracking infrastructure is solid. Meta now has the data it needs to measure, optimize, and scale your campaigns effectively.

Tracking breaks quietly, and usually months later

Everything above is a setup job you do once. The failure mode is what comes after it. A theme update strips the base code. A checkout change stops firing Purchase. A plugin update starts double-counting. Event match quality drifts down as more of your traffic arrives without the customer data CAPI needs. None of these announce themselves. Most accounts find them the way described in Step 4, by chance, after a month of quietly worse delivery.

Monitoring that on a schedule is one of the jobs Nova does. Nova is AdAdvisor's AI media buyer for Meta. Alongside running the account she audits your pixel, your server events, and your event match quality on a recurring basis, so a break surfaces as a flagged issue instead of as an unexplained drop in results. She works in Suggest mode by default, which means anything she proposes waits on your approval before it runs. Once she has earned it, you can switch her to Autopilot, where she executes inside the spend caps, geographies, and exclusions you set and only pings you when she hits something she cannot decide alone.

Nova is running live accounts today. Access is by application while the founding cohort onboards.

Meta Pixel FAQ

Meta Conversions API (CAPI): Setup, Deduplication, and Why You Still Need the Pixel

Analytics & Reporting

Meta Conversions API (CAPI): Setup, Deduplication, and Why You Still Need the Pixel

Set up the Meta Conversions API correctly: Shopify, WooCommerce, and direct integration paths, plus deduplication and Event Match Quality benchmarks.

Read more

Ready to Turn Your Tracking Data into Results?

Setting up the pixel is the technical foundation, but tracking is just the beginning. You also need the right strategy to turn that data into profitable campaigns.

That is exactly what AdAdvisor does. Once your pixel is firing and collecting data, AdAdvisor analyzes your campaigns automatically, breaks down your audience insights, and prepares 1-click implementation recommendations to optimize your ad performance. You review and approve. AdAdvisor handles the rest.

You handle the setup. AdAdvisor handles the optimization.

This is Part 4 of our 5-part Meta Ads Setup Series.

Wissam Hallak

Written by

Wissam Hallak

Co-Founder of AdAdvisor and Owner of Wesso Digital. Paid Ads Specialist.