Track user behavior, measure feature adoption, and understand product usage with a unified analytics API. Swap providers without changing application code.
Open-source product analytics with session replay and feature flags
POSTHOG_API_KEYPOSTHOG_HOSTEvent-based product analytics with funnel and retention analysis
MIXPANEL_TOKENProduct analytics with behavioral cohorting and experimentation
AMPLITUDE_API_KEYTrack events
Send analytics events through the unified API
import { analytics } from '@/lib/analytics'
// Track a custom event
analytics.track('button_clicked', {
buttonId: 'signup-cta',
page: '/landing',
})
// Identify a user
analytics.identify(userId, {
plan: 'pro',
signupDate: new Date(),
})Add analytics to your Primstack project with a single command:
prim analytics init