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

# User Events

> [!NOTE]
>
> **Prerequisites**
>
> * [Castled SDK is installed and initialised](https://docs.castled.io/developer-resources/sdk-integration/js/getting-started.md)

The `track` call lets you record the customer events, i.e. the actions that they perform, along with any associated properties. The events collected can be used to trigger campaigns/workflows and also be synced to your data warehouse.

A sample `track` call is shown below:

```javascript
castledanalytics.track(
  "Added to Cart",
  {
    value: 30,
    currency: "USD",
    item: "product A",
  },
  () => {
    console.log("in track call")
  }
)
```

* **event-name** is a string to identify the user event
* **properties** is a flat-map of event properties


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.