PostHog post-wizard report

The wizard has completed a deep integration of PostHog analytics into the Guild membership platform. Both client-side and server-side tracking are in place, with user identification on login and signup. A reverse proxy is configured so PostHog requests route through /ingest to avoid ad-blockers. Error tracking via captureException is wired into key client-side error paths.

New files created:

  • instrumentation-client.ts — PostHog client-side initialization (Next.js 15.3+ pattern, no provider needed)
  • src/lib/posthog-server.ts — Singleton posthog-node client for server-side capture

Modified files:

  • next.config.ts — Added /ingest rewrites and skipTrailingSlashRedirect
  • .env.local — Added NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN and NEXT_PUBLIC_POSTHOG_HOST
EventDescriptionFile
signup_submittedUser successfully submits the signup formsrc/app/(frontend)/signup/signup-form.tsx
login_succeededUser logs in successfully; identify() calledsrc/app/(frontend)/login/login-form.tsx
login_failedLogin attempt failssrc/app/(frontend)/login/login-form.tsx
email_verifiedEmail verification link clicked and verifiedsrc/app/(frontend)/verify-email/verify-email-handler.tsx
tier_upgrade_clickedMember clicks Upgrade on the tier comparison cardsrc/app/(frontend)/dashboard/tiers/tier-comparison.tsx
manage_subscription_clickedMember opens the Stripe billing portalsrc/app/(frontend)/dashboard/tiers/manage-subscription-button.tsx
checkout_startedStripe Checkout session created (server-side)src/app/api/checkout/route.ts
subscription_activatedStripe subscription created/activated (webhook)src/app/api/webhooks/stripe/route.ts
subscription_canceledStripe subscription deleted (webhook)src/app/api/webhooks/stripe/route.ts
payment_failedStripe invoice payment failed (webhook)src/app/api/webhooks/stripe/route.ts
purchase_points_earnedSquare purchase processed, points awarded (webhook)src/app/api/webhooks/square/route.ts
points_redeemedStaff redeems loyalty points for a membersrc/app/api/redeem/route.ts

Next steps

We’ve built some insights and a dashboard for you to keep an eye on user behavior, based on the events we just instrumented:

Agent skill

We’ve left an agent skill folder in your project. You can use this context for further agent development when using Claude Code. This will help ensure the model provides the most up-to-date approaches for integrating PostHog.