Prompt
How do I set up event tracking for product analytics?
Latest observation
Setting up event tracking for product analytics is mostly about defining what to track, how to name it, and how to send it reliably. Here’s a practical way to do it.
1) Start with the questions you want to answer
Don’t track everything. First define the product questions you care about, such as:
- What actions lead to activation?
- Where do users drop off in onboarding?
- Which features correlate with retention?
- What drives conversion or upgrades?
These questions determine your event schema.
2) Define a tracking plan
Create a simple spec for each event:
- Event name: e.g.
signup_completed - Description: what it means
- When it fires: exact user action / system condition
- Properties: context included with the event
- User traits: stable attributes about the user
- Owner: who maintains it
Example:
| Event | Fires when | Properties |
|---|---|---|
signup_started | user opens signup form | source, device_type |
signup_completed | account is created | plan_selected, referrer, country |
project_created | user creates first project | template_used, project_type |
3) Use consistent naming conventions
Good event names are:
- Action-based:
button_clicked,checkout_started,invite_sent - Past tense for completed actions:
order_completed - Clear and specific: avoid
clickedorsubmittedwithout context
Recommended conventions:
- Events:
snake_caseorverb_noun - Properties:
snake_case - Boolean values: true/false
- IDs: consistent strings, not display names
Avoid:
misc_event- multiple names for the same action
- mixing page views and business events without a reason
4) Decide what to track at different levels
Usually you want three categories:
A. Core product events
Important user actions:
signup_completedonboarding_step_completedfeature_usedsubscription_started
B. System/context events
Useful for segmentation and debugging:
page_viewedapi_erroremail_deliveredintegration_connected
C. User and account traits
Stable attributes:
user_idaccount_idplanrolesignup_datecountry
5) Instrument the events in your app
Use your analytics SDK or event pipeline to send events from the app and/or backend.
Typical pattern:
- Frontend: capture UI interactions
- Backend: capture authoritative business events
- Server-side events: preferred for revenue, subscriptions, and anything that must be accurate
Example payload:
{
"event": "project_created",
"user_id": "u_123",
"account_id": "a_456",
"properties": {
"template_used": "marketing",
"project_type": "campaign"
},
"timestamp": "2026-10-30T12:00:00Z"
}
6) Make identities consistent
You need to know who the event belongs to.
Best practice:
- Track an anonymous ID before login/signup
- Merge anonymous and known user IDs after signup/login
- Always include a stable
user_id - Include
account_idfor B2B products
This helps you connect pre-signup and post-signup behavior.
7) Capture important properties
Properties add analytical value. Include context that helps slicing data later, but avoid overloading events.
Useful properties:
sourcedevice_typeplatformplanfeature_nameexperiment_variantcountryreferrer
Avoid:
- personally sensitive data unless necessary and permitted
- free-text fields that are hard to analyze
- too many properties that won’t be used
8) Validate data quality
Tracking breaks easily, so test it.
Checklist:
- Event fires exactly once when expected
- Properties are correct
- Events appear in analytics tool
- Anonymous/known identity stitching works
- Events fire in production, staging, and mobile/web correctly
- Timezones and timestamps are correct
9) Use an event taxonomy
A useful structure is:
- Lifecycle events: signup, activation, retention, revenue
- Feature events: key actions within features
- System events: errors, syncs, integrations
- Marketing attribution events: acquisition source, campaign
This makes dashboards easier to build.
10) Build a few core funnels and cohorts
Once tracking is in place, create dashboards for:
- Acquisition → signup → activation
- Activation → first value
- Feature adoption
- Retention by segment
- Conversion to paid
Example funnel:
signup_startedsignup_completedonboarding_completedfirst_key_action_completed
11) Keep a tracking governance process
As the product changes, event tracking can get messy. Set ownership and review:
- Require a tracking plan for new features
- Review new events before release
- Deprecate unused events
- Version your event schema if needed
12) Choose the right tooling
Common setup:
- Analytics tool: Amplitude, Mixpanel, PostHog, Heap, GA4
- CDP / routing: Segment, RudderStack
- Warehouse: BigQuery, Snowflake, Redshift
- Data transformation: dbt
If you want flexibility, send events to both your analytics tool and warehouse.
A simple starter event plan
If you’re just starting, track these first:
account_createdsignup_completedonboarding_startedonboarding_completedfeature_usedinvite_sentsubscription_startedsubscription_canceled
And attach properties like:
plansourcefeature_nameroleexperiment_variant
Common mistakes to avoid
- Tracking too many events too early
- Not defining event names consistently
- Using only frontend events for critical business actions
- Forgetting identity stitching
- Capturing data without a clear use case
- Letting tracking drift as the product evolves
If you want, I can also give you:
- a sample tracking plan template,
- a recommended event schema for SaaS, or
- code examples for Segment, Amplitude, PostHog, or GA4.