TSTrackStack
HomeDocsPricingBlogChangelogSign inGet started
Back to blog
ProductApril 1, 2026·4 min read·TrackStack Team

Using PostHog and TrackStack together

PostHog answers product questions; TrackStack delivers conversions to ad platforms. Here is how to run both without duplicate scripts, conflicting proxies, or split event schemas.

  • PostHog
  • integrations
  • proxy
  • analytics

On this page

  1. Different jobs
  2. Single proxy setup
  3. Event naming discipline
  4. Dashboard configuration
  5. Future docs

Problem: Product uses PostHog for funnels and session replay. Marketing needs Meta and Google conversion data. You do not want two SDKs, two proxies, and two event naming conventions in the same Next.js app.

Different jobs

PostHog is product analytics: feature adoption, retention cohorts, session replay. TrackStack is conversion infrastructure: deliver SignUp and Purchase to ad platform CAPIs with delivery logs and retries.

They overlap on capture but diverge on destinations. PostHog does not send hashed PII to Meta. TrackStack does not replace PostHog's product UI.

Single proxy setup

TrackStack can proxy PostHog through a first-party path like /_ph via withTrackStack in next.config.ts. One proxy serves PostHog ingest and TrackStack edge events.

See Integrations for configuration options.

export const trackstack = createTrackStack({
  publicKey: process.env.NEXT_PUBLIC_TRACKSTACK_KEY!,
  posthog: {
    key: process.env.NEXT_PUBLIC_POSTHOG_KEY!,
    host: "/_ph",
  },
});

Event naming discipline

Keep PostHog events descriptive for product (feature_export_clicked). Keep TrackStack events canonical for ads (SignUp, Purchase, StartTrial).

Do not mirror every PostHog event to ad platforms — noise hurts optimization.

posthog.capture("onboarding_step_completed", { step: 2 });

trackstack.capture("SignUp", {
  email: user.email,
  eventId: `signup_${user.id}`,
});

Dashboard configuration

Connect PostHog as a source in Settings → Integrations if you want webhook forwarding. For most teams, client-side dual capture with shared proxy is simpler.

Use PostHog for product debugging. Use delivery logs for ad HTTP responses.

Future docs

A dedicated /docs/integrations/posthog page is on the content backlog — until then, start from quickstart plus the proxy config above.

Key takeaways

  • PostHog is product analytics; TrackStack is ad platform delivery — complementary, not redundant.
  • Share one first-party proxy path to reduce DNS and allowlist complexity.
  • Use canonical conversion events for ads; keep granular product events in PostHog only.

Sources

Official documentation and references cited in this article.

  • PostHog — Reverse proxy
  • Meta — Conversions API overview

More in Product

Product4 min read

Domain allowlisting for public API keys

TrackStack public keys ship in client bundles. Domain allowlisting restricts which origins can send events — a basic security control every production app should configure.

Read post
Product4 min read

Delivery logs: debug CAPI like you debug API requests

Every conversion should leave an HTTP trail. Delivery logs show platform responses, payloads, and retries — so you fix match issues before wasting ad spend.

Read post
Product4 min read

Configure: map canonical events to ad platforms

The Configure split separates credentials, per-platform event allowlists, and checklists from generic settings — so you ship destinations without tag manager indirection.

Read post

Ready to fix your conversion pipeline?

Install the TrackStack SDK, route events to Meta and Google, and verify delivery from one dashboard.

Get started freeView quickstart

© 2026 TrackStack. First-party conversion infrastructure.

DocsPricingBlogChangelog