Skip to content
LeadSpyKit

Ads & tracking

Meta Pixel and Conversions API Code Generator

Generate Pixel base code, event snippets and server-side CAPI samples.

How to use it

  1. Enter your Pixel ID and choose your platform.
  2. Select the events you want to track.
  3. Copy the browser snippets into your site.
  4. Use the server sample to send the same events through the Conversions API with a shared event_id.

Create the Meta Pixel base code, standard event snippets with value and currency, and server-side Conversions API examples in Node, PHP and Python, including SHA-256 hashing and event_id deduplication.

Want to automate this?

Pixel & Tag Inspector: See which pixels fire on any page, live. Free.

See Pixel & Tag Inspector

FAQ

Do I need an access token here?

No. The generator uses placeholders. Never paste a real access token into any website; keep it in your server environment variables.

Why send events from the browser and the server?

Using both improves resilience to blockers. Meta removes duplicates when both events carry the same event_id and event name.

Is the API version up to date?

The version is a single constant in the generated code. Check Meta's changelog and update it when needed.

Related tools

More from LeadSpyKit: all free tools