Create and install a Facebook pixel
253,315 views
See an overview of how Apple's iOS 14 changes may affect advertising with Meta.
If you already set up your pixel using IMG tags or plan to do so, we recommend that you follow our developer documentation. Learn more.
In this article, we'll cover how to create and install a pixel on your website. To learn more about the pixel before getting started, take a look at the benefits of installing a Facebook pixel.
If you've already created a pixel and want to find your pixel base code, skip to section 2, Add the Facebook pixel to your website. Follow the instructions to Manually add pixel code to website.
Before you begin
- You need a website for your business.
- You must be able to update your website's code.
Create a Facebook pixel
- Go to Events Manager.
- Click
Connect data sources and select Web. - Select Facebook pixel and click Connect.
- Add your pixel name.
- Enter your website URL to check for easy setup options.
- Click Continue.
Add the Facebook pixel to your website
Once you've created your pixel, you're ready to put the Facebook pixel code on your website. For instructions on how to do this, choose your setup option:
- Go to Events Manager.
- Select the pixel you want to set up.
- Click Continue pixel setup.
- Select Install code manually.
- Copy the pixel base code.
- Find the header of your website or locate the header template in your CMS or web platform.
- Paste the base code at the bottom of the header section, just above the closing head tag.
- Click Continue.
- Optional: Toggle on Automatic advanced matching and verify the customer information that you want to send.
- Click Continue.
- Add events using the Event setup tool or by manually adding code to your website.
- Click Launch Event setup tool to add events and parameters without additional coding.
- Follow the on-screen instructions to add events to your website.
- Click Done.

- Go to Events Manager.
- Select the pixel you want to set up.
- Click Continue pixel setup.
- Click Use a partner.
- Select a partner from the list.
- Follow the on-screen setup instructions.
You can also set up your Facebook pixel on your website by going to the Partner integrations page in Events Manager, selecting your partner and following the on-screen instructions. Learn more about the benefits of using partner integrations to set up your pixel.
If you can't see your platform, use one of the other two ways to set up your pixel.
If someone else updates the code on your website, follow these steps to email them your Facebook pixel setup instructions.
- Go to Events Manager.
- Select the pixel you want to set up.
- Click Continue pixel setup.
- Click Email instructions.
- Enter the recipient's email address.
- Click Send at the bottom of the page.
Set up events
After you add the pixel base code to your website, you can set up events to measure the actions you care about, such as making a purchase. You can do this by manually installing the code or by using the point-and-click Event setup tool. Then, make sure that your pixel is working correctly.
You can use one pixel across your whole website, including multiple pages of your website.
If you use the pixel to share events with Facebook, we recommend that you also use the Conversions API. The Conversions API works with your pixel to help improve the performance and measurement of your Facebook ad campaigns. Learn more about the Conversions API.
Note: Apple's iOS 14 changes require apps in the App Store that engage in what Apple defines as "tracking" to show a prompt to iOS 14.5 and later users in accordance with their AppTrackingTransparency framework. These changes affect how Facebook receives and processes events from tools such as the Facebook pixel. If you optimise, target or report on web events from Facebook pixel or any of our other business tools, you can take steps to update your event setup and manage these changes. Learn more.
EVENTS |
Facebook pixel
Facebook can help your large, medium or small business grow. Get the latest news for advertisers and more on our Meta for Business Page.
