Guide
Meta Pixel Setup Guide: From Zero to a Working Test
How to create a Meta Pixel, install it, send standard events with value and currency, test it, and add the Conversions API with deduplication.
What the Meta Pixel does
The Meta Pixel is a small piece of JavaScript that reports what visitors do on your site (page views, add to cart, purchase) to Meta. Ads delivery and measurement use those signals.
Menu names in Meta's tools change from time to time. Use the steps below as a map, and check Meta's current help pages if a label looks different.
1. Create the Pixel
- Open Meta Events Manager with the business account that owns your ad account.
- Choose to connect a new data source for your website and create a Pixel.
- Give it a clear name and note the Pixel ID (a long number).
2. Install the base code
Put the base code in the head of every page, or use your platform's official integration (Shopify, WordPress plugins or Google Tag Manager). Install it once; installing it twice causes duplicate page views.
Our Meta Pixel and Conversions API code generator produces the base code and event snippets for you.
3. Send the events that matter
Always send value and currency with Purchase. Without them, optimisation and ROAS reporting are limited.
- ViewContent on product or landing pages
- AddToCart and InitiateCheckout in the shopping flow
- Purchase on the thank-you step, with value and currency
- Lead or CompleteRegistration for lead-generation sites
4. Test before spending money
- Use the Test Events tab in Events Manager to see events arrive in real time.
- Install the free Pixel & Tag Inspector extension to see every event and its parameters in your browser.
- Run a full test purchase and check that Purchase fires once, with the right value.
5. Add the Conversions API
The Conversions API sends the same events from your server. When both browser and server send an event, give them the same event_id and event name so Meta can remove the duplicate.
Hash customer data such as email and phone with SHA-256 after normalising it (trim, lower case for email, digits only for phone). Never expose your access token in front-end code.
Common mistakes
- Two copies of the Pixel on the same page
- Purchase firing on page refresh
- Missing value or currency
- Server events without event_id, so nothing is deduplicated
Try it yourself
Meta Pixel and Conversions API Code Generator: Generate Pixel base code, event snippets and server-side CAPI samples.
Last updated 2026-11-05. Platform menus and policies change; check the official help pages when in doubt.