Facebook Pixel Code Generator

Build the base Meta (Facebook) Pixel code for your website from your Pixel ID, with an optional standard event such as Purchase or Lead and its value and currency.

1 Fill in the boxes

2 Your answer

Your answer shows here as you type.

How to use the Facebook Pixel Code Generator

  1. Enter your Pixel ID from Meta Events Manager, under Data Sources.
  2. Choose PageView for the base tracking code, or a standard event for a specific action.
  3. For Purchase or other value events, add the amount and a three-letter currency code.
  4. Copy the code and paste it into the head section of every page you want to track.

Frequently asked questions

Where do I find my Meta Pixel ID?

In Meta Events Manager, open the Data Sources menu and select your pixel. The ID is a numeric string, usually 15 or 16 digits, shown under the pixel name.

Where should the pixel code go on my site?

Paste the base code into the head section of every page you want to track, or into a site-wide template or tag manager container. Event calls such as Purchase should run on the page where that action happens.

What does the noscript part do?

It is a fallback for visitors with JavaScript turned off. It sends a single PageView as a 1 by 1 pixel image request to Meta.

What currency code should I use?

Use the three-letter ISO 4217 code for the currency of the value, such as USD, EUR or GBP.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.