How to Set Up Facebook Pixel in Meta Business

Cody Schneider9 min read

Getting your Meta Pixel (formerly the Facebook Pixel) installed is one of the most important first steps for running effective ad campaigns. This small piece of code is the brain behind your ad targeting, tracking, and optimization. This article provides a straightforward, step-by-step guide to creating your pixel, installing it on your website, and making sure it’s tracking activity correctly.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

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

The Meta Pixel is a snippet of tracking code that you place on your website. Once installed, it acts as a bridge between your site and your Meta Ads account (which covers Facebook and Instagram). It observes the actions people take on your website - like viewing a product, adding an item to their cart, or making a purchase - and sends that data back to Meta.

This information is incredibly valuable for your advertising efforts. Without it, you're essentially running ads with a blindfold on. Here's what the pixel enables you to do:

  • Track Conversions: See which ads are actually leading to sales, sign-ups, or other valuable actions on your website. This helps you understand your return on ad spend (ROAS) and focus your budget on what works.
  • Optimize Ads for Conversions: Meta’s algorithm can use the pixel data to automatically show your ads to people who are most likely to take the action you want them to, improving your campaign performance and lowering your cost per conversion.
  • Build Retargeting Audiences: You can create custom audiences of people who have already visited your website or engaged with specific products. For example, you can show a special offer to everyone who added an item to their cart but didn't complete the purchase.
  • Create Lookalike Audiences: Meta can analyze the characteristics of your best customers (based on pixel data) and build a new "lookalike" audience of people who share similar traits but haven't interacted with your business yet. This is a powerful way to find new customers.

Simply put, the Meta Pixel turns your website traffic into actionable data that powers smarter, more profitable advertising campaigns.

Before You Begin: What You'll Need

Before you get started, make sure you have two things ready to go:

  1. An Active Website: You need to have a website where you can add the pixel tracking code. You’ll also need the ability to edit your website's header code yourself or have a developer who can do it for you.
  2. A Meta Business Account: You create and manage your pixel from within the Meta Business Suite or Business Manager. Your ad account should be connected to a Business Account. If you don't have one, you can set it up for free at business.facebook.com.

Step 1: Create a Meta Pixel in Events Manager

First, you need to generate the pixel itself within your Meta Business Account. All of your data sources, including pixels, are managed inside a tool called Events Manager.

  1. Navigate to your Meta Events Manager. You can do this by going to your Meta Business Suite and clicking the "All Tools" hamburger menu, then selecting Events Manager.
  2. In the sidebar on the left, click the green plus icon that says "Connect data sources."
  3. A window will pop up asking what you want to connect. Select Web and click "Connect."
  4. Now, you'll be asked to name your pixel. Choose a name that clearly identifies your business or website, especially if you manage multiple sites. For example, "Sarah's Online Bakery Pixel." Click "Create Pixel."
  5. Next, enter your website’s URL and click "Check." Meta will look for easy setup options based on your website's platform.

At this point, your pixel exists, but it isn't collecting any data because it hasn't been added to your website yet. The next steps will connect it to your site.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step 2: Install the Pixel Code on Your Website

This is where most beginners get a bit nervous, but Meta has made the process much easier over the years. You have a few options for getting the code onto your site, ranging from super simple to slightly more technical.

Method 1: Partner Integration (The Easiest Option)

If your website is built on a popular platform like Shopify, WordPress, BigCommerce, Squarespace, or Wix, this is the best and easiest method. These platforms have built-in integrations that handle the technical work for you.

After you check your website's URL in the Events Manager setup, Meta will likely prompt you to use a partner integration if it recognizes your platform.

  • Select your website platform from a list (e.g., WordPress, Shopify).
  • Meta will then give you specific, step-by-step instructions. Often, this involves installing an official Meta Pixel app or plugin on your site and connecting your account.
  • For example, with Shopify, you’ll be prompted to install the Facebook & Instagram app in the Shopify App Store and log in. With WordPress, you might be guided to install a specific plugin.
  • Follow the on-screen instructions carefully. Once completed, the integration automatically places the pixel code and often sets up key e-commerce events (like AddToCart, InitiateCheckout, and Purchase) for you.

Method 2: Manually Installing the Pixel Code

If you have a custom-built website or use a platform that isn't listed as a partner, you’ll need to add the code manually. Don't worry, this just involves a bit of copying and pasting.

In the setup process, choose the "Install code manually" option.

Meta will present a box containing your pixel’s base code. It will look something 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-GOES-HERE'),
fbq('track', 'PageView'),
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=YOUR-PIXEL-ID-GOES-HERE&ev=PageView"
/></noscript>
<!-- End Meta Pixel Code -->
  1. Click the "Copy code" button.
  2. Next, you need to paste this code into the header section of your website. Find the <head> tag in your website's HTML template file. Add the pixel code right before the closing </head> tag.
  3. Adding this code to your sitewide header template ensures the pixel will load on every single page of your website, which is exactly what you want.
GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Method 3: Email Instructions to a Developer

If you don't manage your website's code and have a developer who does, you can choose the "Email instructions" option. This will send all the necessary technical details directly to your chosen email address so your developer can handle the installation for you.

Step 3: Set Up Specific Events to Track

Just installing the base code allows the pixel to track PageView events, which is a good start. But for running effective campaigns, you need to track more specific actions, known as "events."

Common events you might want to track include:

  • Purchase: When a customer completes an order.
  • AddToCart: When someone adds a product to their shopping cart.
  • Lead: When someone submits a form on your site.
  • CompleteRegistration: When a user signs up for an account.
  • ViewContent: When a user visits a key page, like a product page.

The easiest way to set these up without any coding is by using Meta’s Event Setup Tool.

Using the Event Setup Tool

After you’ve added the pixel's base code, click "Continue" in Events Manager. Meta will ask you to turn on "Automatic Advanced Matching" - it's a good idea to leave this on, as it helps connect website activity more accurately to Meta profiles.

Next, click "Open Event Setup Tool."

  1. Enter your website's URL and click "Open Website."
  2. Your website will load in a new browser tab with the Event Setup Tool overlay on top of it.
  3. You can now browse your site like a normal visitor. When you get to a page or button you want to track, you can tell the tool what action it represents.
  4. To track an action on a button (like "Add to Cart" or "Subscribe"), click "Track New Button." The tool will highlight all the clickable buttons on the page. Select one, and a menu will appear allowing you to assign a standard event to it (e.g., Assign AddToCart).
  5. To track visits to a specific page (like a "Thank You" or confirmation page after a purchase), click "Track a URL." You can then define the event that happens when someone lands on that specific page (e.g., Purchase).

The Event Setup Tool is an amazing, user-friendly way to get detailed event tracking without needing to code. Once you’re finished adding events, click "Finish Setup" in the corner.

Step 4: Verify Your Pixel is Working Correctly

Once you've installed the code and set up events, the final critical step is making sure everything is working as expected.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Check Events Manager

Go back to the Overview tab in your Events Manager. If your pixel is correctly installed on your site and you've had some traffic (you can visit the site yourself), you should start seeing the status change to "Active." You’ll also see a chart showing recent activity and a list of the events being received.

Note: It can sometimes take 20-30 minutes for activity to register for the first time.

Use a Browser Extension

One of the best ways to test your new setup is with the Meta Pixel Helper, a free Google Chrome extension. Once you install it, you can visit any page on your website and click the Pixel Helper icon in your browser's toolbar.

It will show you:

  • Which pixels were found on the page.
  • Whether those pixels loaded successfully.
  • Which events fired on that page (for example, on a product page you should see PageView and ViewContent fire).
  • If there are any problems or errors, the tool often gives clues on how to fix them. A green checkmark means everything is working perfectly.

This little tool is invaluable for troubleshooting your installation and making sure every key event is firing exactly where it should.

Final Thoughts

Setting up your Meta Pixel correctly is a foundational step for anyone serious about using Facebook and Instagram ads to grow their business. It unlocks the platform’s most powerful tools, transforming your website's visitor data into powerful insights for ad optimization, conversion tracking, and intelligent audience targeting. By following these steps, you can get it up and running with confidence.

Of course, once you’ve connected your Meta Pixel, a dozen other data sources are still scattered across different platforms. We built Graphed to solve this headache. Instead of jumping between Google Analytics, Facebook Ads Manager, and your Shopify dashboard, we centralize all your data seamlessly. You can simply ask a question like, "Show me my Facebook ad spend versus Shopify revenue by campaign for the last month," and immediately get a real-time dashboard showing the answer - no coding or spreadsheet skills required.

Related Articles