Get the Meta Pixel base code for your site, plus ready-made code for standard events like Purchase, Lead and AddToCart.
Loading the tool…
Standard events
| Event | Use it when | Key parameters |
|---|---|---|
| ViewContent | Someone views a product or key page | content_ids, value, currency |
| AddToCart | An item is added to the basket | content_ids, value, currency |
| InitiateCheckout | Checkout starts | num_items, value, currency |
| Purchase | An order is completed | value and currency (required) |
| Lead | A form is submitted | value, currency |
| CompleteRegistration | Someone signs up | value, currency |
| Subscribe | A paid subscription starts | value, currency, predicted_ltv |
How to install
- Paste the base code inside the <head> of every page.
- Add each event’s code where the action happens, for example the Purchase code on the order confirmation page.
- Open Events Manager, use Test events, and check each event arrives with the right value.
Privacy and accuracy
Browsers and ad blockers stop some pixel events, so many advertisers also send events through Meta’s Conversions API from their server. In the UK and EU, you’ll usually need consent before the pixel runs.
Frequently asked questions
Where do I find my Pixel ID?
In Meta Events Manager, under Data sources. It’s a long number, also called a dataset ID.
Is Purchase value required?
Yes, Purchase events need value and currency.
What is a custom event?
An event with your own name, sent with fbq(‘trackCustom’). Use standard events where they fit.
Is it still called the Facebook Pixel?
Meta renamed it the Meta Pixel, but it’s the same code.
Sources
- Meta for Developers: Get started with the Meta Pixel
- Meta for Developers: Pixel reference and standard events
Last updated: