How to set up Meta CAPI in Next.js without GTM
A developer's guide to bypassing Google Tag Manager and setting up first-party server-side tracking in Next.js.
Read postTrackStack replaces pixel soup with one SDK that routes your conversion events through a first-party proxy to Meta, Google, LinkedIn, TikTok, and more. Set it up in minutes and see exactly what landed with delivery logs.
Supported destinations
~10 minutes
Setup time
10 destinations
Supported platforms
Retry + DLQ built in
Safety
Drop in the SDK, and let us handle the ad platform specs, retries, and delivery logs.
Send canonical events from your app with the TrackStack SDK.
TrackStack maps and fans out payloads across platform conversion APIs.
Monitor delivery, retries, and failures from one operational dashboard.
Install once, configure once, and start routing conversions with confidence.
Install in 60 seconds
Start with a minimal config and keep one shared event pipeline for all your conversion platforms.
npm install @trackstack/sdkMeta Ads conversion events with pixel + CAPI deduplication.
Google Ads and GA4 conversion routing with purchase-focused mapping.
LinkedIn conversion delivery with lead and purchase normalization.
Reddit Ads CAPI delivery with event-id aware retry handling.
TikTok Events API routing with high-throughput batch semantics.
X conversion delivery with OAuth 1.0a-ready edge transport.
Microsoft UET client tracking; server-side adapter in planning.
Quora conversion routing with deterministic event shaping.
Pinterest pixel tracking available; edge CAPI adapter is planned.
Snap Pixel support in SDK toggles; edge CAPI adapter is planned.
import { createTrackStack } from "@trackstack/sdk";
export const ts = createTrackStack({
publicKey: process.env.NEXT_PUBLIC_TRACKSTACK_KEY!,
edge: "https://edge.gettrackstack.com",
platforms: {
"meta": true,
"google": true,
"linkedin": true,
"reddit": true,
"tiktok": true,
"x": true,
"microsoft": true,
"quora": true,
"pinterest": true,
"snapchat": true
},
consent: { ad_storage: "granted" }, // optional consent state
});
// In your app
ts.identify("user_123", { email, plan: "growth" });
ts.capture("SignUp", { email, platformHints: ["web", "app"] });3. Go to Dashboard → Settings → Platform Tokens and add your destination credentials.
Your app only uses a publishable TrackStack key. Destination platform tokens stay in your dashboard settings and are encrypted server-side.
Drop it into your Next.js/React app. Works alongside PostHog, Clerk, and Stripe.
Analytics
Auth
Payments
Frameworks
Core capabilities included by default so you can replace brittle pixel and tag setups.
Direct market analysis on where conversion products fail and how to pick the right architecture.
A developer's guide to bypassing Google Tag Manager and setting up first-party server-side tracking in Next.js.
Read postAd blockers, ITP, and iOS updates are killing client-side tracking. Here's why you need a first-party proxy.
Read postWhy Customer Data Platforms (CDPs) are the wrong tool for setting up simple, reliable ad tracking.
Read postCreate an API key, install the SDK, and route your first event in minutes.