Meta Business Help Centre
Best practices for Meta pixel setup
You can use these best practices during and after Meta pixel setup to check that you successfully installed your pixel and events.
During Meta pixel setup
- Check that your pixel base code is accurate. If you installed the pixel using code on your website, make sure that everything between the <script> and </script> tags exactly matches your pixel base code. If you installed the pixel using a tag manager, then you won't see the code on the actual web page so you'll have to troubleshoot within your tag manager.
- Check that you added the event code in the correct place. Here's an example of what your website code might look like with the add to cart event installed:
- Your website's original code.
- Your pixel base code.
- Your standard event code.
- Make sure that your standard events are spelt correctly in code. Events are case sensitive, so if you accidentally add fbq('track', 'viewcontent'); to one of your web pages instead of the correct standard event code fbq('track', 'ViewContent'); you'll see an event called viewcontent appear as a custom event in Meta Events Manager.
After Meta pixel setup
- Use the Conversions API in addition to the Meta pixel, and share the same events using both tools. We call this a redundant event setup. For example, if you share the purchase, initiate checkout and contact events using the pixel, share those same web events from your server using the Conversions API. Redundant setups are useful because the Conversions API allows you to share website events that the pixel may fail to capture due to network connectivity issues or page loading errors. Learn how to check if you're sharing redundant web events.
- Use the test events tool to check that you set up your standard or custom events correctly. If you see any unusual activity, you can also use the Test events tool to debug your events.
- Check the Diagnostics tab in Events Manager to find and resolve problems related to your event setup. You'll also see recommendations to improve your event setup if we detect a problem.
- If you can't access the ad account with the pixel you want to test, download the Meta pixel helper. A pop-up tells you what pixel and events were found on the Page, and if they loaded successfully. If the page view event (which is automatically included as part of your pixel base code) loads on every web page, and each standard event loads successfully (only on the pages you added them to), then you can start using your pixel.
- Go to a web page where you've installed the entire pixel base code, including the page view event. The page view event is automatically included as part of your pixel base code. If your pixel is working correctly, it will send the page view event back to Meta. The Page view event will appear on your pixel's Page in Events Manager. Your pixel's status will also be set to Active.
If you've successfully set up your pixel, you're ready to use the pixel for advertising.
Note: You can use one pixel across your whole website, including multiple pages of your website. However, there may be a need to use two pixels on one website. For example, if two different agencies run ads for your business, they may each need to set up a separate pixel on your website. Learn more about using multiple pixels on Meta for Developers.