Skip to content

Events and conversions

px('track', 'signup', { plan: 'pro' }) // a custom event
px('conversion', 'trial_started') // a conversion
px('identify', user.id) // an opaque id; only its hash is kept
const visit = px('visitId') // for Stripe metadata; undefined until the script has loaded

With the npm package the same calls are functions: track, conversion, identify, visitId.

  • Names: letters, digits and _ . : -, starting with a letter or digit, up to 64 characters.
  • Up to 32 properties per event: strings (up to 256 characters), numbers or booleans. null values are dropped.
  • Never put personal data in names or properties. Emails and long digit runs are replaced with [redacted] anyway.

A conversion is an event that counts as a goal: it appears in the Conversions total, in the dashboard’s events panel and in what_changed. Break one down by property with GET /v1/sites/{id}/stats/events?name=trial_started.

Events that happen on the server (a payment confirmed, a plan changed) can be sent with the server SDK, signed with your key.