Facebook Tips & Strategies

How to Install Facebook Pixel

By Spencer Lanoue
October 31, 2025

Installing what’s now known as the Meta Pixel is one of the most powerful steps you can take to make your social media ads work harder for you. It’s the key to understanding how people interact with your website after seeing your ads. This guide breaks down exactly what the Meta Pixel does, why it’s essential, and provides clear, step-by-step instructions on how to install it, whether you're using a popular platform like Shopify or a custom-built site.

What Exactly is the Meta Pixel?

In simple terms, the Meta Pixel (formerly the Facebook Pixel) is a small snippet of JavaScript code that you place on your website. Once installed, it acts like a bridge between your website and your Meta Ads Manager. Think of it as a silent employee who watches everyone who visits your site and reports their actions back to Meta. This anonymous data allows you to track conversions, retarget visitors, and give Meta's algorithm the information it needs to find your ideal customers.

If you're still seeing references to the "Facebook Pixel," don't worry. Meta rebranded it, but the functionality remains the same. The pixel is the foundational tool for running effective advertising campaigns on Facebook and Instagram.

Why It’s a Game-Changer for Your Marketing

Before you get into the installation, it helps to understand why this is so important. Without the pixel, you're essentially advertising in the dark. With it, you unlock three major capabilities:

  • Track Conversions and ROAS: The pixel allows you to see what actions people take after clicking your ad. Did they make a purchase? Fill out a contact form? Sign up for your newsletter? By tracking these conversions, you can measure your return on ad spend (ROAS) and know for sure which campaigns are driving real business results.
  • Build Powerful Custom Audiences for Retargeting: The pixel helps you create highly specific audience lists based on website activity. For example, you can create an audience of everyone who visited a specific product page but didn't buy, or an audience of people who added items to their cart and then left. You can then show these warm audiences targeted ads to bring them back.
  • Optimize Your Ads for Better Results: When you tell Meta you want to optimize for purchases, the pixel sends data back to the platform about who is already buying from you. Meta's algorithm then analyzes the shared characteristics of those buyers and shows your ads to other users who look just like them. This process, known as conversion optimization, is impossible without the pixel.

Step 1: Creating Your Meta Pixel in Meta Events Manager

Before you can install the pixel, you first need to create one. Luckily, this part is quick and easy. Every Meta ad account can create multiple pixels.

Here’s how to generate your pixel:

  1. Navigate to Meta Events Manager. You'll need to be logged into the Facebook account associated with your business.
  2. Look for the green plus icon on the left-hand navigation panel that says "Connect Data Sources" and click it.
  3. A window will pop up asking what you want to connect. Select "Web" and click "Connect."
  4. Give your pixel a name. It’s best practice to name it after your business to keep things organized, like "Your Brand's Pixel."
  5. Enter your website's URL. This helps Meta check if you're using a platform with an easy partner integration.
  6. Click "Create Pixel."

That's it! You've officially created your pixel. Now you just need to get it onto your website.

Step 2: Choosing Your Installation Method

After creating your pixel, Meta will present you with two main ways to install it. The right choice depends entirely on your website platform and your comfort level with code.

  • Method 1: Partner Integration. This is the easiest and most common method. If your website is built on a platform like Shopify, WordPress, Squarespace, Wix, or BigCommerce, you can use a built-in integration that handles almost all the work for you. You typically just need your Pixel ID.
  • Method 2: Manual Installation. This option requires you to copy the entire pixel code snippet and paste it into the header code of your website. This is the best choice for custom-built websites or when a partner integration isn’t available.

There's also a third option, "Email Instructions to a Developer," which is exactly what it sounds like. If you have a developer on your team, you can simply send them everything they need with a few clicks.

Method 1: Using a Partner Integration (Recommended for Most Users)

This is the no-code, headache-free way to get your pixel up and running. Here are the steps for two of the most popular platforms.

Installing the Pixel on Shopify

Shopify makes this process incredibly simple.

  1. In Meta Events Manager, locate your Pixel ID. It's a long number that you can find under your pixel's name in Events Manager, or in the install instructions. Copy this ID.
  2. Log in to your Shopify Admin dashboard.
  3. In the left-hand menu, navigate to Online Store >, Preferences.
  4. Scroll down until you see the section labeled "Meta Pixel" (it may still say Facebook Pixel).
  5. Paste your Pixel ID into the box and click "Save."

And you're done! Shopify automatically adds the pixel code to every page of your site, including your checkout pages, and sets up key e-commerce events like `AddToCart`, `InitiateCheckout`, and `Purchase`.

Installing the Pixel on WordPress

For WordPress, the best way to install the pixel is with a plugin. While you could edit your theme files manually, a plugin prevents you from losing the pixel code every time you update your theme.

  1. From your WordPress dashboard, go to Plugins >, Add New.
  2. Search for "Meta Pixel." You’ll see several options, including the official "Meta Pixel for WordPress" plugin or popular third-party tools like PixelYourSite. Choose one with good reviews and install it.
  3. After activating the plugin, find its settings page (usually in the main WordPress menu).
  4. The plugin will have a dedicated field for your Meta Pixel ID. Copy your ID from Meta Events Manager and paste it in.
  5. Save your changes.

Just like that, your pixel is now active across your WordPress site. Most modern plugins will also help you set up conversion events.

Method 2: Manually Installing the Pixel Code

If you have a custom-built website or your platform doesn't have an integration, you'll need to install the code manually. While it involves looking at code, you're mostly just copying and pasting.

Heads up: This involves editing your website’s theme files. It's always a good idea to back up your website before making changes to the code.

  1. In the pixel setup process within Meta Events Manager, choose "Install code manually."
  2. Meta will generate your base pixel code snippet. It will look like a block of text starting with <,!-- Meta Pixel Code -->,. Click the "Copy Code" button.
  3. Now, you need to access your website's header code. The pixel needs to be placed on every single page of your site. Most websites have a universal header file (like `header.php` or `theme.liquid`) that controls this. Your goal is to paste the code right before the closing <,/head>, tag.

Here’s a generic example of where it should go:

<,html>,
<,head>,
<,title>,My Awesome Website<,/title>,
<,meta charset="UTF-8">,
<,!-- other header info goes here -->,

<,!-- 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 -->,

<,/head>,
<,body>,
<,!-- a rest of a page -->,
<,/body>,
<,/html>,

Once you've pasted the code into your site's header, save the file. The Meta Pixel is now live!

While installing, Meta will ask if you want to turn on Automatic Advanced Matching. It's highly recommended you turn this on. It allows the pixel to safely grab hashed customer data (like email addresses or phone numbers) they provide on your site, which helps Meta match visitors to their Facebook profiles with much greater accuracy.

Step 3: Verifying Your Pixel is Working Correctly

Once you've finished the installation, you need to confirm it’s actually working. The easiest way to do this is with a free browser extension from Meta.

  1. Download the "Meta Pixel Helper" extension for Google Chrome.
  2. Once installed, visit your website.
  3. Click on the Pixel Helper icon in your browser's toolbar.

If everything is set up correctly, a small window will pop up showing your Pixel ID and a green checkmark next to a "PageView" event. This confirms that the pixel is successfully firing on your site. If you see an error, the extension will provide information to help you troubleshoot the problem.

Beyond the Basics: Setting Up Events and the Conversions API

The base pixel installation tracks page views, which is great, but the real power comes from tracking specific actions called Standard Events. These are things like `Purchase`, `Lead`, `AddToCart`, or `CompleteRegistration`. You can add these with Meta's codeless Event Setup Tool or by adding small snippets of code to key pages on your site.

You may also hear about the Conversions API (CAPI). Think of it as a partner to the pixel. While the pixel sends data from the user's browser, the CAPI sends data directly from your server to Meta's. This creates a more stable connection that can't be disrupted by ad blockers or browser privacy settings, giving you more reliable and complete data. Setting it up is a next-level step, but worth looking into once your pixel is running smoothly.

Final Thoughts

Getting your Meta Pixel installed is a foundational step for anyone serious about growing their business with Facebook and Instagram ads. With this data-tracking powerhouse in place, you can finally understand your campaign performance, retarget interested visitors, and let Meta’s algorithm find you new customers.

Once you have that valuable audience data, creating content that truly connects becomes everything. At Postbase, we're focused on making the creative side of social media management simple and effective. A reliable pixel helps you understand who to target, and our platform helps you plan, schedule, and analyze the engaging content - especially short-form video for Reels and TikTok - that will resonate with them.

Spencer's spent a decade building products at companies like Buffer, UserTesting, and Bump Health. He's spent years in the weeds of social media management—scheduling posts, analyzing performance, coordinating teams. At Postbase, he's building tools to automate the busywork so you can focus on creating great content.

Other posts you might like

How to Add Social Media Icons to an Email Signature

Enhance your email signature by adding social media icons. Discover step-by-step instructions to turn every email into a powerful marketing tool.

Read more

How to Add an Etsy Link to Pinterest

Learn how to add your Etsy link to Pinterest and drive traffic to your shop. Discover strategies to create converting pins and turn browsers into customers.

Read more

How to Grant Access to Facebook Business Manager

Grant access to your Facebook Business Manager securely. Follow our step-by-step guide to add users and assign permissions without sharing your password.

Read more

How to Record Audio for Instagram Reels

Record clear audio for Instagram Reels with this guide. Learn actionable steps to create professional-sounding audio, using just your phone or upgraded gear.

Read more

How to Add Translation in an Instagram Post

Add translations to Instagram posts and connect globally. Learn manual techniques and discover Instagram's automatic translation features in this guide.

Read more

How to Optimize Facebook for Business

Optimize your Facebook Business Page for growth and sales with strategic tweaks. Learn to engage your community, create captivating content, and refine strategies.

Read more

Stop wrestling with outdated social media tools

Wrestling with social media? It doesn’t have to be this hard. Plan your content, schedule posts, respond to comments, and analyze performance — all in one simple, easy-to-use tool.

Schedule your first post
The simplest way to manage your social media
Rating