How to set up Meta CAPI in Next.js without GTM
Problem: Developers hate setting up Google Tag Manager. It's a marketing tool that forces you into a slow, fragile workflow. But Meta CAPI usually requires it or a complex custom backend.
The problem with GTM for developers
GTM was built for marketers to inject JavaScript without asking engineering. But for modern React/Next.js apps, it breaks the component model, slows down page loads, and creates a black box where you have no idea if your events actually fired.
When you add Server-Side GTM (sGTM) to the mix for Meta CAPI, you're now managing infrastructure, maintaining Docker containers, and mapping variables in a clunky UI.
The SDK approach to CAPI
Instead of a tag manager, you can use a tracking SDK that natively understands Meta's Conversions API. You drop it into your Next.js app, configure it with your pixel ID, and call `capture('Purchase')`.
A good SDK handles the hashing (Meta requires SHA256 for user data like email), the network retries, and the event mapping (mapping your 'Purchase' to Meta's `Purchase` standard event).
Seeing what actually landed
The biggest advantage of the SDK approach is delivery logs. In GTM, an event goes into the void. With an SDK like TrackStack, you get a dashboard showing exactly which events hit Meta, their payload, and their HTTP status code.
Key takeaways
- You don't need GTM to implement Meta CAPI.
- An SDK approach fits perfectly into modern Next.js/React workflows.
- Delivery logs are the only way to know your tracking actually works.