> ## Documentation Index
> Fetch the complete documentation index at: https://docs.userpilot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tracked Events

> Sending tracked events and passing them to Userpilot is an easy and straightforward approach by calling the tracking method.

### Overview

Sending tracked events and passing them to Userpilot is an easy and straightforward approach by calling the tracking method. This is the technical approach for sending tracked events from both Web and Mobile applications, which could contain metadata (event properties). We also support creating tracked events through Userpilot content by clicking on a certain button, and directly creating the tracked events from the events dashboard.

### Use Cases

* Trigger content based on user behavior

* Analyze visitors' behavior and activity on your web app

* Identify how much users are interacting with a certain element of your product

* Defining a goal using events to measure the impact of your in-flows on user behavior

* Enable business teams to make efficient decisions about increasing the effectiveness of their digital marketing activities

### Tracked Events Function

Sending tracked events and metadata to Userpilot by calling the `userpilot.track()` function.

<Danger title="Limits and best practices">
  You can have up to **10,000 unique event names** and **512 KB** total size per application. If you're approaching or hitting these limits, it's a sign to revisit how you're sending events.

  **Don't** use `userpilot.track()` for every click or input with dynamic IDs in the name (e.g. `button-click-976728`). For those, use [auto-capture and labeling](/data-events/autocapture/visual-labeler) instead, you get one stable event per interaction type without hitting the limit.

  **Do** reserve tracked events for things only your app can tell product teams about (payments, DB changes, key state changes) and put the detail in **metadata**, e.g. `userpilot.track("List toggle", { listId: "976728" })` instead of a new event name per ID eg. `list-toggle-976728`.
</Danger>

<CodeGroup>
  ```javascript Web theme={null}
  //tracking your events using the Track method
  <script>
  userpilot.track("Event");
  </script>
  //Specify more information about your event (metadata)
  <script>
  userpilot.track("Created an Invoice", {
   number_of_invoices: 2,
  });
  </script>
  //Another example
  <script>
  var meta = {URL: "/growth"};
  userpilot.track("Page Event", meta);
  </script>
  ```

  ```javascript iOS theme={null}
  userpilot.track("Added to Cart", properties: ["itemId": "sku_456", "price": 29.99])
  ```

  ```javascript Android theme={null}
  userpilot.track("Added to Cart", mapOf("itemId" to "sku_456", "price" to 29.99))
  ```
</CodeGroup>

### Button Tracked Events

Userpilot can track events through button clicks by enabling the Track event function for any button within the Userpilot content. Once the user clicks on the button after publishing the related content, data is sent to your Userpilot account showing the tracked event data.

<img src="https://mintcdn.com/userpilot/O1qxAMlVdU0FgGNP/data-events/tracked-events/assets/images/Screenshot2025-02-21182750.png?fit=max&auto=format&n=O1qxAMlVdU0FgGNP&q=85&s=d9f97875fef022fe0aa1d69669da97e8" alt="" width="622" height="563" data-path="data-events/tracked-events/assets/images/Screenshot2025-02-21182750.png" />

<Note>
  The event needs to occur at least once (related button clicked/triggered live) to show in your dashboard
</Note>

### Tracked Events Dashboard

Once any Tracked Event has been sent to Userpilot it should be found in the [Events Dashboard](https://run.userpilot.io/events/overview) under the Events table.

<img src="https://mintcdn.com/userpilot/O1qxAMlVdU0FgGNP/data-events/tracked-events/assets/images/Screenshot2025-02-21192759.png?fit=max&auto=format&n=O1qxAMlVdU0FgGNP&q=85&s=92799ece7f1543e2ee7f58a4ac06e9f5" alt="" width="1766" height="725" data-path="data-events/tracked-events/assets/images/Screenshot2025-02-21192759.png" />

Entering an event will show the related analytics, in addition to the Overview chart that can be clicked to see the related event occurrences in a certain time period and the event metadata or any properties. In addition to the User/Company activity table that shows the total occurrences, and first/last occurrence of the event.

There are also other ways to create tracked events such as directly creating them from the Events dashboard by adding the name and event key to track the event in your web app, then sharing it with your dev team to be called upon certain actions by your users. Sending tracked events through HTTP Rest API and the Bulk Data Import API is also supported.

<img src="https://mintcdn.com/userpilot/O1qxAMlVdU0FgGNP/data-events/tracked-events/assets/images/Screenshot2025-02-21194350.png?fit=max&auto=format&n=O1qxAMlVdU0FgGNP&q=85&s=638e9750372d37b83340ec24f87e59da" alt="" width="1775" height="361" data-path="data-events/tracked-events/assets/images/Screenshot2025-02-21194350.png" />

### FAQs

<AccordionGroup>
  <Accordion title="How long does it take for Tracked Event to show in Userpilot?" defaultOpen={false}>
    Tracked events would show right away, they're updated in real time.
  </Accordion>

  <Accordion title="Can Tracked Events be deleted?" defaultOpen={false}>
    No, there is no current way to fully delete a tracked event, but they can be archived and won't show anywhere in the app once done till they're unarchived again.
  </Accordion>
</AccordionGroup>

<Frame as="div">
  [For any questions or concerns please reach out to **support@userpilot.com**](mailto:support@userpilot.com)
</Frame>
