Naming events

A handful of well named events answers more than a hundred vague ones. Start with five to eight.

Track outcomes that mean something

Page views and clicks are already captured. Custom events are for what datacub cannot see: that something worked. Good first events for most products:

EventWhen it firesProperties
signup_completedthe account was createdmethod
onboarding_step_completedeach onboarding step, as one eventstep
project_createdthe first moment someone gets value (yours may differ)template
checkout_completedthe server confirmed the paymentplan, currency, value
subscription_started, subscription_cancelledthe subscription changedplan
invite_senta teammate was invitedrole

The rules

  • object_action, snake case, past tense: invoice_paid, report_exported. Not Clicked Pay Button or paymentSuccess.
  • One event with a property beats many events: onboarding_step_completed with { step: 'profile' }, not onboarding_profile_done, onboarding_team_done.
  • Names never change: a renamed event is a new event, and old charts stop matching. Pick carefully, then keep it.
  • No values in names: never plan_pro_selected or anything with an ID. Values go in properties.
  • Properties are few, flat and repeatable: plan names, steps, counts, true or false. Not free text, not who the user is.
  • English names, any UI language: names are for your team and your code. Reports show them as written.
// one event, the step as a property
datacub.track('onboarding_step_completed', { step: 'profile' })
datacub.track('onboarding_step_completed', { step: 'invite_team' })

Where to put the call

Next to the code that does the action, after it succeeded. Then the event stays right when the button moves, the copy changes or a second screen does the same thing.

export async function inviteTeammate(email: string, role: 'admin' | 'member') {
  await api.createInvite({ email, role })
  // the email stays in your system; datacub only needs the fact
  datacub.track('invite_sent', { role })
}

For funnels built from these events, see funnels and retention.