> ## 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** \\
>
> Tracking needs to be enabled during SDK initialization for this feature to work.
> Set `CastledConfigs.enableTracking` to `true` to enable tracking.

`logCustomEvent` method can be used to log user events. Any params associated with the events is passed to the method as a flatmap.

```swift swift
Castled.sharedInstance.logCustomAppEvent("Test Event", params: ["Int": 100, "DOB": "12-16-2000", "Name": "Antony"])
```

```objc objc
[[Castled sharedInstance] logCustomAppEvent:@"Test Event" params:@{@"Int": @100,
                                                               @"DOB": @"12-16-2000",
                                                               @"Name": @"Antony"}];
```

These events can be used as the **trigger events** for your push, inapp and inbox campaigns or workflows. Also can be used to create user segments for your future campaigns.


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