← Home

Mixpanel

Mixpanel is a platform that provides simple product analytics across Just About, it's currently in use in next-app, strapi & discord.

Mixpanel provides developers with the ability to send arbitrary events to Mixpanel for any user action / event that occurs, which can then be tracked & viewed via the Mixpanel dashboard by product people.

For example, collecting insights into how many people click a button can be done like the following:

  1. Add an event type to the EventTypes enum https://github.com/Just-about/just-about/blob/167945845174d5f202a78aa65b41b2f24de7d096/apps/next-app/app/_utils/events.ts#L22-L22
enum EventTypes {
  CLICKED_BUTTON = "User clicked a button", // Used when the user clicks this button
  // ...
}
  1. Add a tracking function to the Track object which can be used in the rest of the app https://github.com/Just-about/just-about/blob/167945845174d5f202a78aa65b41b2f24de7d096/apps/next-app/app/_utils/events.ts#L94-L94
Track = {
  clickedButton: () => trackEvent(EventTypes.CLICKED_BUTTON, undefined, {}),
}
  1. Use the new track function in components
<JAButton onClick={Track.clickedButton} label="Click me!" />
  1. Track the event in Mixpanel