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— Singletonposthog-nodeclient for server-side capture
Modified files:
next.config.ts— Added/ingestrewrites andskipTrailingSlashRedirect.env.local— AddedNEXT_PUBLIC_POSTHOG_PROJECT_TOKENandNEXT_PUBLIC_POSTHOG_HOST
| Event | Description | File |
|---|---|---|
signup_submitted | User successfully submits the signup form | src/app/(frontend)/signup/signup-form.tsx |
login_succeeded | User logs in successfully; identify() called | src/app/(frontend)/login/login-form.tsx |
login_failed | Login attempt fails | src/app/(frontend)/login/login-form.tsx |
email_verified | Email verification link clicked and verified | src/app/(frontend)/verify-email/verify-email-handler.tsx |
tier_upgrade_clicked | Member clicks Upgrade on the tier comparison card | src/app/(frontend)/dashboard/tiers/tier-comparison.tsx |
manage_subscription_clicked | Member opens the Stripe billing portal | src/app/(frontend)/dashboard/tiers/manage-subscription-button.tsx |
checkout_started | Stripe Checkout session created (server-side) | src/app/api/checkout/route.ts |
subscription_activated | Stripe subscription created/activated (webhook) | src/app/api/webhooks/stripe/route.ts |
subscription_canceled | Stripe subscription deleted (webhook) | src/app/api/webhooks/stripe/route.ts |
payment_failed | Stripe invoice payment failed (webhook) | src/app/api/webhooks/stripe/route.ts |
purchase_points_earned | Square purchase processed, points awarded (webhook) | src/app/api/webhooks/square/route.ts |
points_redeemed | Staff redeems loyalty points for a member | src/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:
- Dashboard — Analytics basics: https://us.posthog.com/project/370533/dashboard/1433786
- Insight — Signup to subscription funnel: https://us.posthog.com/project/370533/insights/x3ums8Dd
- Insight — Subscription health (activations / cancellations / payment failures): https://us.posthog.com/project/370533/insights/iOA5GI7V
- Insight — Tier upgrade conversion funnel: https://us.posthog.com/project/370533/insights/aPtUOtFI
- Insight — Loyalty activity (purchases earning points vs redemptions): https://us.posthog.com/project/370533/insights/zeNw6Wrt
- Insight — Daily active members: https://us.posthog.com/project/370533/insights/UYwE9Q9x
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.