About five minutes, on the free plan, without a credit card.
1
Install and initialise the web SDK
Setting apiUrl is required. Without it the SDK sends events to OpenPanel's own hosted API instead of Privytics. If you would rather not add a dependency, the plain script tag from https://privytics.com/op1.js takes the same options.
// npm install @openpanel/web
import { OpenPanel } from '@openpanel/web';
export const op = new OpenPanel({
clientId: 'YOUR_CLIENT_ID',
apiUrl: 'https://api.privytics.com',
trackScreenViews: true,
trackOutgoingLinks: true,
});
2
Identify the user after login
Pass the id from your own users table as profileId. Everything tracked from that point is attributed to the profile, which is what makes cohorts and the per-user timeline work. This is the identified layer, so decide your lawful basis for it before you ship. Call clear() on logout so a shared machine does not attribute the next session to the previous account.
// after your login or session-restore call resolves
op.identify({
profileId: user.id,
email: user.email,
firstName: user.firstName,
lastName: user.lastName,
properties: {
plan: user.plan,
workspace_id: user.workspaceId,
signup_week: user.signupWeek,
},
});
// on logout
op.clear();
3
Track the activation path as named events
Keep the list short and stable. Name events after what the user did, in past tense, and put the variable parts in properties rather than in the event name. Five to ten well-chosen events give you a usable funnel; fifty ad hoc ones give you a cleanup project.
// 1. account created
op.track('signup_completed', { plan: 'free', source: 'pricing_page' });
// 2. first real setup step
op.track('workspace_created', { workspace_id: workspace.id });
// 3. the collaboration moment
op.track('teammate_invited', { invited_count: 3 });
// 4. the moment the product does its job
op.track('integration_connected', { provider: 'github' });
op.track('first_report_created', { report_type: 'funnel' });
// 5. the commercial steps
op.track('trial_started', { plan: 'pro' });
op.track('plan_upgraded', { from_plan: 'free', to_plan: 'pro' });