PostHog Event Tracking Setup

Set up comprehensive event tracking in PostHog without writing code. Capture user actions, identify users with properties, and track page views across your entire funnel.

Event trackingUser identificationFunnel analyticsProduct analytics

The Challenge

Setting up event tracking in PostHog usually means writing code, deploying changes, and waiting for data to flow through before you know if everything is wired up correctly. You end up going back and forth between your codebase and the PostHog dashboard, fixing typos in event names and missing properties. What should take an hour turns into a full afternoon of debugging why events aren't showing up.

What This Prompt Does

Identify Users

Set user properties like email, plan, and company so every event ties back to a real person

Capture Custom Events

Send events for signups, purchases, and feature usage with structured properties

Track Page Views

Record page views across your funnel with URLs, titles, and referrer data

Verify Setup

Get a complete summary of everything tracked so you can confirm it in the PostHog dashboard

The Prompt

The Prompt

Task

Use @PostHog/Capture EventName it "PostHog/Capture Event" and call it with @PostHog/Capture Event to send custom events for key user actions (signups, purchases, feature usage), @PostHog/Identify UserName it "PostHog/Identify User" and call it with @PostHog/Identify User to set user properties like email, plan, and company, and @PostHog/Track Page ViewName it "PostHog/Track Page View" and call it with @PostHog/Track Page View to record page views across the conversion funnel. This sets up a complete event tracking foundation in PostHog for any product or website.

Input

The user provides:

  1. A list of key user actions to track (e.g., "signup", "purchase", "feature_activated")
  2. User properties to set during identification (e.g., email, plan tier, company name)
  3. Page URLs or routes to track views for (e.g., "/pricing", "/signup", "/dashboard")
  4. A distinct user ID or email to associate events with

Example: "Set up tracking for our SaaS onboarding funnel: track page views on /pricing, /signup, and /welcome, capture signup_completed and first_project_created events, and identify the user with their email and plan tier."

Context

User Identification

  1. Use @PostHog/Identify UserName it "PostHog/Identify User" and call it with @PostHog/Identify User to set the user's distinct ID and properties
  2. Include properties like email, name, plan, company, signup date
  3. This should happen first so all subsequent events are associated with the identified user
  4. Update properties whenever they change (e.g., plan upgrade, new company name)

Event Capture

  1. Use @PostHog/Capture EventName it "PostHog/Capture Event" and call it with @PostHog/Capture Event for each key user action
  2. Include relevant properties with each event:
    • For signups: signup method, referral source, plan selected
    • For purchases: amount, currency, product, payment method
    • For feature usage: feature name, usage count, context
  3. Use consistent event naming conventions (snake_case recommended)
  4. Include timestamps and session context where available

Page View Tracking

  1. Use @PostHog/Track Page ViewName it "PostHog/Track Page View" and call it with @PostHog/Track Page View for each page in the funnel
  2. Include the full URL, page title, and any relevant UTM parameters
  3. Track views in sequence to build funnel visibility
  4. Include referrer information when available

Verification

After setting up tracking:

  • Confirm each event was captured successfully
  • Verify user properties were set correctly
  • Check that page views are recording with the right URLs
  • Summarize the complete tracking plan that was implemented

Output

Tracking Setup Summary:

User Identified:

  • Distinct ID: [user_id]
  • Properties set: [list of properties with values]

Events Captured: | Event Name | Properties | Status | |------------|-----------|--------| | [event_name] | [key properties] | Sent |

Page Views Tracked: | Page | URL | Title | Status | |------|-----|-------|--------| | [page_name] | [url] | [title] | Tracked |

Next Steps:

  • Verify events appear in PostHog dashboard within 1-2 minutes
  • Set up funnels in PostHog using the captured events
  • Create cohorts based on user properties for segmentation

Example Usage

Try asking:

  • "Set up PostHog tracking for our signup funnel: identify users by email, capture signup_started and signup_completed events, and track views on /signup and /welcome"
  • "Track purchase events in PostHog with amount, currency, and product properties for user john@example.com"
  • "Set up full event tracking for our SaaS: page views on /pricing, /signup, /dashboard, and capture feature_used events with feature name properties"