Ads & tracking
Meta Pixel and Conversions API Code Generator
Generate Pixel base code, event snippets and server-side CAPI samples.
How to use it
- Enter your Pixel ID and choose your platform.
- Select the events you want to track.
- Copy the browser snippets into your site.
- 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.
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
Pixel Checker
Paste a URL and see which tracking tags are in its HTML.
UTM Builder
Create clean, consistent campaign links with presets and bulk mode.
Ad Budget, ROAS, CPA and CPM Calculators
ROAS, break-even ROAS, CPA, CPM, CPC, CTR, CVR and a budget planner.
More from LeadSpyKit: all free tools