Option 1: Setup with your AI Agent using PixelFlow MCP
If you already use an AI agent like Claude, ChatGPT or Cursor, this is the quickest way to set up the Meta Conversions API and pixel on your Next.js site.
Option 2: Set up manually using PixelFlow
Step 1: Add PixelFlow to your Next.js app
These steps only need doing once. Go through them in order.
Let your coding agent add it. If you build with Claude Code, Cursor or Codex, connect PixelFlow over MCP and ask it to add the snippet to your root layout for you.
Step 2: Track forms, buttons, page loads and 3rd party tools
With the snippet in your root layout, PixelFlow tracks PageViews automatically. To track forms, button clicks, page loads or events from 3rd party platforms like Stripe or Calendly, use any of these:
Open your site in PixelFlow and click Track More events
Choose the event name you'd like to send to Meta (eg. Lead, Contact, Schedule)
Choose how to trigger it (form, button click or 3rd party integration) and complete the steps shown
You can trigger Meta events from your Next.js site in a few ways:
Visual Tagger: click the buttons, links and forms on your Next.js site that should send an event.
URL triggers: send an event when a visitor reaches a page, like your thank-you page.
3rd party integrations: connect apps such as Stripe and Calendly in PixelFlow to pass purchases and bookings on to Meta and your other ad platforms.
Set up with AI: describe the events you want to your AI agent and it sets the triggers up through PixelFlow MCP.
Step 3: Remove any existing Meta Pixel
To stop duplicate events, remove any Meta Pixel you previously added to Next.js.
Search your codebase for fbq( or connect.facebook.net and delete the Meta Pixel code, often in app/layout.tsx, pages/_document.tsx or pages/_app.tsx.
Remove any pixel package such as react-facebook-pixel and the code that calls it.
If you use Google Tag Manager, delete or pause the Meta Pixel tag and publish the container.
In Meta Events Manager, go to your Pixel's Settings and turn off tracking events automatically without code.
Redeploy so the changes go live.
Meta is just the start. The same script can send your conversions to TikTok, ChatGPT Ads, Snapchat, Pinterest and Reddit, with no extra code.

Smarter, server-side tracking
Start sending accurate conversions today - no tag manager, no code, no developer required.
Compatible with


