> ## 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/php/getting-started.md)

Use the `track` static method in Castled SDK to record user activity on your application. The events collected can be used a trigger for campaigns/workflows and also synced to your data warehouse.

```php
Castled::track([
        'event' => 'order_status_update',
        'userId' => '12345',
        'properties' => [
            'plan' => 'basic',
            'order_id' => 'o1'
        ]
    ]);
```


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