Events

There's no need to deploy expensive third-party analytics tools to track user behaviour in Gravity as it comes with client-side event tracking and analytics built in.

Track Events

To track an event, simply import the Event component and call the create method with an event name and optional metadata. This will log a new event in your database.

You can toggle the server-side logging using the STORE_EVENT_LOGS env var.

import { Event } from 'components/lib';

export function Upgrade(props){

  async function upgradePlan(){
   
     Event.create({ name: 'upgrade', metadata: { plan: 'Unicorn' });
 
  };
}

Standard Events

The following events are already configured for you:

  • signin

  • selected_plan

  • completed_onboarding

  • cancelled_onboarding

  • upgraded

  • invited_user

  • closed_account

Event Analytics

You can get a birds eye view of all of your event data in Mission Control. Here you can see:

  • the total number of triggers for each event

  • events charted over time

  • a list of all events

  • individual event detail

Need to see events by a specific user? Search for their email address in the event listing page.

Last updated