Add a Meta Pixel to your website (2026)

4 min read

What you’ll have at the end

A Meta Pixel created in Meta Events Manager, its base code added to your website, and a page view recorded in Events Manager to show it's working. Meta says the pixel is a piece of code on your website that lets you measure the effectiveness of your Meta advertising by understanding the actions people take on your website.

Before you start

You’ll need

  • A business website you own
  • A way to edit your website's code, yourself or through your developer
  • A Facebook account with access to Meta Events Manager

What it costs. Meta's pixel help lists no charge for creating or installing a pixel.

Meta says you need a business website, and that you or your developer must be able to update your website's code. If someone else looks after your website, step 9 lets you email them the instructions.

Please read two rules from Meta's pixel help first: - Don't place the pixel on websites you don't own without permission. - Don't share prohibited information with Meta through the pixel. Meta says this includes health, financial or children's data.

If your website runs on a platform such as Shopify or WordPress, Meta may offer a partner integration at step 5. That route uses your platform's own steps instead of steps 6 to 12.

Steps

  1. 1. Open Meta Events Manager

    On a computer, sign in and go to Meta Events Manager. Meta's developer page says you can reach it from Ads Manager.

  2. 2. Click Connect data and select Web

    Click Connect data, then select Web.

  3. 3. Click Connect

    Click Connect.

  4. 4. Name your pixel and click Create pixel

    Enter a name for your pixel, such as your business name, then click Create pixel. Meta says this creates a new ID that you can see in Events Manager.

  5. 5. Enter your website address and click Check

    Enter your website's address, then click Check. Meta looks for partner integrations that fit your website.

    If a partner integration appears, Meta suggests clicking Next and following the on-screen instructions on your partner's website. That route is different from this guide, so this guide ends there for you.

  6. 6. Click Next

    If no partner integration is shown, click Next.

  7. 7. Choose Do it yourself

    Meta asks how you'd like to connect your data: Get guidance or Do it yourself. Meta recommends Get guidance, which gives you setup recommendations on screen to follow instead of the rest of this guide.

    This guide follows Do it yourself, which Meta describes as for people who already know how they'd like to connect their data.

  8. 8. Select Meta pixel only and click Next

    Select Meta pixel only, then click Next.

  9. 9. Choose Install code manually

    Choose Install code manually. If a developer will add the pixel for you, you can click Email instructions instead, and this guide ends there.

  10. 10. Copy the base code

    Copy the pixel's base code that Events Manager shows you.

  11. 11. Add the base code to your website's head section

    On your website, paste the base code between the opening and closing head tags, on every page where you'd like to measure what visitors do. Meta's developer page says most developers add it to the website's persistent header, so it appears on all pages. Then save or publish the change on your website.

  12. 12. Check that the pixel records a page view

    Open a page of your website that has the pixel. Then, in Events Manager, find your pixel and open its details. Meta's developer page says that if you see a new PageView event, the pixel is installed, and that if you don't see it, you can wait a few minutes and refresh the page. This guide ends here.

If something looks different

  • At step 8, Meta also offers Conversions API and Meta pixel. Meta recommends using the Conversions API alongside the pixel, and says it helps improve the performance and measurement of your Meta ad campaigns. Its setup has its own options and isn't covered here.
  • If you use a tag manager, Meta's developer page says the pixel works in most tag managers, and suggests your tag manager's own help for the steps.
  • If you don't have a website, Meta offers a box at step 5 to say so, and a different route.
  • If the pixel still doesn't record a page view, Meta's developer page suggests using Meta Ads Data Advisor to find the problem.
  • Measuring actions such as a purchase is a separate step after this one. Meta calls these events.