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.
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:
- A list of key user actions to track (e.g., "signup", "purchase", "feature_activated")
- User properties to set during identification (e.g., email, plan tier, company name)
- Page URLs or routes to track views for (e.g., "/pricing", "/signup", "/dashboard")
- 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
- Use @PostHog/Identify UserName it "PostHog/Identify User" and call it with @PostHog/Identify User to set the user's distinct ID and properties
- Include properties like email, name, plan, company, signup date
- This should happen first so all subsequent events are associated with the identified user
- Update properties whenever they change (e.g., plan upgrade, new company name)
Event Capture
- Use @PostHog/Capture EventName it "PostHog/Capture Event" and call it with @PostHog/Capture Event for each key user action
- 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
- Use consistent event naming conventions (snake_case recommended)
- Include timestamps and session context where available
Page View Tracking
- Use @PostHog/Track Page ViewName it "PostHog/Track Page View" and call it with @PostHog/Track Page View for each page in the funnel
- Include the full URL, page title, and any relevant UTM parameters
- Track views in sequence to build funnel visibility
- 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"