In this article, we'll cover how to install a pixel on your website, track actions on your site that you care about, and make sure that your pixel is working. To learn more about pixel before getting started, check out the benefits of installing a Facebook pixel.
Before you begin
-
You'll need a website for your business.
-
You must be able to update your website's code.
Create a Facebook pixel
- Go to your Pixels tab in Ads Manager.
- Click Create a Pixel.
- Click Create in the box that appears to finish creating your pixel.
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. Choose the statement below that best fits how you make updates to your website's code for instructions:
If someone else updates the code in your website, then follow the steps below to email them instructions to set up the Facebook pixel on your site.
1. Go to the Pixels tab in Ads Manager.
2. Click Set Up Pixel
3. Click Email Instructions to a Developer.

4. Enter the recipient’s email address.

5. Click Send at the bottom of the page.
1. Locate the header code for your website
Go to your website's code and find the header of your website.

2. Copy the entire code and paste it in the header of your website
Paste the code at the bottom of the header section, just above the closing head tag.

3. Check that your code's working correctly
Click Send Test Traffic after placing the code on your website to make sure your pixel's working properly. If your status says "Active", your base code has been installed correctly. This can take several minutes to update.

Select your platform or tag manager from this list for an even easier way to set up your pixel. If you don't see your platform here, then check out one of the other two ways of setting up your pixel above.
Website platforms:
Tag managers
Learn more about the benefits of using a third party platform to set up your pixel.
Track actions that matter to your business
After you've placed the pixel your website, add events to track specific actions people take on your website.
About events
Events are actions that happen on your website (like when someone makes a purchase). To track an event, you'll need to place a piece of code on your website to help Facebook understand that someone has taken an action.
Set up events on your website
1. Go to the Pixels tab in Ads Manager.
2. Click Set Up Pixel.
3. Click Manually Install the Code Yourself.
4. Click Continue.
5. Click Install Events.
6. Click the toggle icon next to an event you'd like to track.
7. Select Track Event on Page Load or Track Event on Inline Action.
- Track Event on Page Load: Choose this option if the action you care about can be tracked when someone lands on a certain page, like a confirmation page after completing a purchase.
- Track Event on Inline Action: Choose this option if the action you want to track requires someone to click something (like an add to cart or purchase button).
8. Add event parameters, like Conversion Value or Currency, to measure additional information about your event (Recommended)
9. Copy this event code and paste it on the relevant page of your site. Be sure not to modify the pixel code you've already placed in the header of your website.
- For page load events: place the code just below the closing header section of the page (for many websites, this will be right after the opening <body> tag).
- For inline action events: add the event code between script tags next to the action you want to track (like a button).
If you'd like your Facebook pixel to fire on specific button clicks, you'll have to update the code to tie an event to an action. Learn more in our developers site, under the Track In-Page Events section.
You've now finished setting up an event on your website. Repeat these steps for any other event listed that you'd also like to track.
Don't see the event you want to track?
If you want to track events not listed here, then see how to use custom events. Unlike the events featured above, custom events can't be used for tracking and optimization without additional action.
If you'd like your Facebook pixel to fire on specific button clicks, you'll have to update the code to tie an event to an action. Learn more in our developers site, under the Track In-Page Events section.
Make sure your pixel's working correctly
The Facebook Pixel Helper is a troubleshooting tool that helps you find out if your pixel is working correctly. It's a Chrome plugin you can use to see if there's a Facebook pixel installed on a website, check for errors, and understand the data that's coming from a pixel.
Install the Pixel Helper
Before getting started, you'll need to have the Chrome web browser. If you don't have it yet, install the Chrome browser then follow these steps:
1. Go to the Chrome web store and search for the Facebook Pixel Helper.
2. Click + Add to Chrome.
3. Click Add extension.
Once you've successfully installed the extension you'll see a notification that the plugin has been added to Chrome and a small icon will show in your address bar.
Check that your pixel's working
- After you've installed the Pixel Helper, click the Pixel Helper icon in the address bar.
- Check the popup to see any pixels found on that page, and whether they've been set up successfully.
If the Pixel Helper finds a pixel on your site and there are no errors, then you're ready to start creating Facebook ads with your pixel.
If you see a notification that no pixels were found on your site or that there's an error, then check out the troubleshooting section below for more help.
Troubleshooting Pixel Errors
The Facebook Pixel Helper reports common errors than can happen when you install a pixel on your website. These errors mean that the person who manages your website will need to fix something for your pixel to start working correctly.
- If you click the Pixel Helper icon in the address bar and see a message that no pixels were found on that page, it means that you will need to place the Facebook pixel code on your site. See how to setup your Facebook pixel.
- This means that the Pixel Helper may have found Facebook pixel code on your site, but the pixel isn't passing back data from your site. There are two reasons this might be happening:
- If you've set up your pixel to fire on a dynamic event (like when someone clicks a button on your page). If that's the case, try clicking the button where you've attached your pixel code and clicking on the Pixel Helper again to see if this fixes the problem.
- There could be an error in your pixel base code. If this is the case, you can try deleting the Facebook pixel code you've placed on your site and adding the code again. Learn how to find your pixel base code in Facebook and put it on your site.
- This means that the Pixel Helper found event code on your site that doesn't match one of our 9 Standard Events. This could be a typo, for example, if the event is named “Purchased” instead of “Purchase”. Check out Facebook's standard event names and the exact code you'll need to place on your site to make sure this matches with the event names in your website's code.
- This means that your pixel sent the same signal multiple times to Facebook (which would impact the accuracy of your site's reporting). To fix this, make sure that you've only included the Facebook pixel base code on your site once, and that if you have event code on your site you avoid placing the same event code multiple times on the same page.
- This means that the pixel ID in your Facebook pixel base code isn't recognized by Facebook. To fix this, you'll need to replace the pixel ID in your pixel base code with the pixel ID assigned to an active ad account. Learn how to find your pixel ID.
Read our frequently-asked questions or learn more about the Facebook pixel in our developers site.
Once you've set up your pixel and campaign, learn about reporting on your conversion campaigns.
FAQs
- To continue optimizing your Facebook advertising with pixel, you'll need to transition from the conversion tracking pixel to the Facebook pixel. Learn more about what's happening to the conversion tracking pixel here
- If you've created a Custom Audience pixel in the past, you have an older version of the Facebook pixel and won't see an option to create another. However, we strongly recommend that you update to the Facebook pixel base code and add its event codes to access all the products that can help your business.
Once you've successfully set up your pixel, start running ads on Facebook using conversion optimization and tracking.
Comments
0 comments
Please sign in to leave a comment.