Run · Analytics · intermediate

Set Up PostHog Funnels and Events

Analytics SaaS intermediate PostHog

How to use

  1. Copy the prompt below
  2. Paste it into PostHog
  3. Review the output and follow up with refinements
Prompt
I need to set up PostHog analytics for my SaaS app with custom events, funnels, and user identification so I can understand how people move through my product.

Product details:
- App name: [your app name]
- Framework: [e.g. Next.js, React SPA, Vue]
- Key user actions to track: [e.g. sign up, create project, invite team member, upgrade plan]
- Authentication system: [e.g. Clerk, NextAuth, Supabase Auth, custom]
- PostHog plan: [Free tier or paid]

Set up the following:

1. PostHog installation:
   - Install the posthog-js package
   - Initialize PostHog in my app with the correct API key and host
   - Show me the provider/wrapper pattern for [framework] so it loads on every page
   - Enable autocapture for clicks and pageviews as a baseline

2. User identification:
   - After login, call posthog.identify() with the user's ID and these properties:
     - email: [user email]
     - name: [user name]
     - plan: [free/pro/enterprise]
     - signed_up_at: [signup date]
   - Show me exactly where to place this call in my auth flow
   - Call posthog.reset() on logout

3. Custom event tracking — set up these events:
   - "signed_up" with properties: method [google/email], referral_source
   - "project_created" with properties: template_used, project_type
   - "team_member_invited" with properties: role [admin/member]
   - "plan_upgraded" with properties: from_plan, to_plan, monthly_revenue
   - "feature_used" with properties: feature_name, usage_count
   Give me the exact posthog.capture() call for each.

4. Funnel creation:
   Build these funnels in the PostHog dashboard:
   - Activation funnel: signed_up -> project_created -> feature_used (within 7 days)
   - Upgrade funnel: pricing_page_viewed -> checkout_started -> plan_upgraded
   - Invite funnel: project_created -> team_member_invited
   Walk me through creating each funnel step-by-step in the PostHog UI.

5. Key dashboards to create:
   - Daily active users (DAU) and weekly retention
   - Signup-to-activation conversion rate
   - Feature adoption breakdown (which features get used most)
   - Revenue events timeline (upgrades, downgrades, churn)
   Tell me which PostHog insight type to use for each (trends, funnels, retention, paths).

6. Session recordings (optional):
   - Enable session replay for users who hit an error or drop off during onboarding
   - Set up a recording filter so I only capture sessions on key flows, not everything
   - Explain the privacy/performance implications

Output all code as copy-paste snippets with comments. For dashboard setup, give me click-by-click instructions.

Related prompts

Was this helpful?