# Events

There's no need to deploy expensive third-party analytics tools to track user behaviour in [Gravity](https://usegravity.app) 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.

{% hint style="info" %}
You can toggle the server-side logging using the **`STORE_EVENT_LOGS`** env var.
{% endhint %}

```javascript
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](/mission-control/events.md). Here you can see:

* the total number of triggers for each event&#x20;
* events charted over time
* a list of all events
* individual event detail

{% hint style="info" %}
Need to see events by a specific user? Search for their email address in the event listing page.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usegravity.app/gravity-web/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
