Event Tracking
Track user actions with the PishonIQ SDK
Event tracking forms the foundation of product analytics. PishonIQ provides a straightforward SDK for capturing user behavior across your application.
Track events
Use PishonIQ.track() to record any user action:
PishonIQ.track('button_clicked', {
button_id: 'signup_cta',
page: 'homepage',
})
The first argument is the event name. Use consistent snake_case naming. The second argument is an optional properties object for additional context.
Recommended events
For SaaS products, these events provide strong initial coverage:
| Event | When to fire |
|---|---|
| signup_started | User opens the registration flow |
| signup_completed | User completes registration |
| trial_started | User begins a free trial |
| checkout_started | User opens checkout |
| subscription_created | Payment succeeds |
User identification
Associate events with authenticated users to enable funnels and cohort analysis:
PishonIQ.identify('user_123', {
email: 'user@company.com',
plan: 'indie',
})
Call identify after login or registration. Subsequent events will be linked to that user.
Page views
For single-page applications, track navigation explicitly:
PishonIQ.track('page_view', {
path: window.location.pathname,
title: document.title,
})
In Next.js, invoke this within a route change handler or usePathname effect.
Best practices
- Maintain consistent naming — Use snake_case and past-tense verbs throughout your schema.
- Track with purpose — Instrument events that answer defined product questions.
- Include meaningful properties — Plan tier, acquisition source, and role improve insight quality.
Next steps
Learn how PishonIQ interprets your events in AI Insights.