--- title: "Events" slug: "mapp-intelligence-ios-sdk-v5-events" updated: 2026-04-30T11:47:08Z published: 2026-04-30T11:47:08Z canonical: "docs.mapp.com/mapp-intelligence-ios-sdk-v5-events" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Events Use event tracking to record user actions on a page, such as button taps, swipes, or other interactions that are not screen views. Each action is tied to the current page name and can carry custom event parameters. Before you start, complete the [Quickstart](/v1/docs/mapp-intelligence-ios-sdk-v5-quickstart) so the SDK is initialized. --- ## Method | Method | Description | | --- | --- | | `trackAction(_ event: MIActionEvent)` | Records a user action with optional event, session, user, e-commerce, or campaign parameters. | --- ## Build an action event Use `MIActionEvent` with a name. Attach `MIEventParameters` for action-level data. You can additionally attach any of these optional parameter objects: - `MISessionParameters` — see [Sessions](/v1/docs/mapp-intelligence-ios-sdk-v5-sessions) - `MIUserCategories` — see [Users](/v1/docs/mapp-intelligence-ios-sdk-v5-users) - `MIEcommerceParameters` + `MIProduct` — see [Products and Orders](/v1/docs/mapp-intelligence-ios-sdk-v5-products-and-orders) - `MICampaignParameters` — see [Campaigns](/v1/docs/mapp-intelligence-ios-sdk-v5-campaigns) ### MIEventParameters | Property | Description | | --- | --- | | `parameters` | Dictionary of numbered event parameters (`NSNumber` → `NSString`). | --- ## Examples ### Simple action The simplest form — pass an action name. Useful for quick instrumentation when you don't yet need custom parameters. **Swift** ```swift let actionEvent = MIActionEvent(name: "AddToCart") MappIntelligence.shared()?.trackAction(actionEvent) ``` **Objective-C** ```objectivec MIActionEvent *actionEvent = [[MIActionEvent alloc] initWithName:@"AddToCart"]; [[MappIntelligence shared] trackAction:actionEvent]; ``` ### Action with custom parameters Attach `MIEventParameters` with numbered keys to record additional context for the action. **Swift** ```swift let actionEvent = MIActionEvent(name: "AddToCart") actionEvent.eventParameters = MIEventParameters(dictionary: [    1: "size-42",    2: "color-black" ]) MappIntelligence.shared()?.trackAction(actionEvent) ``` **Objective-C** ```objectivec MIActionEvent *actionEvent = [[MIActionEvent alloc] initWithName:@"AddToCart"]; actionEvent.eventParameters = [[MIEventParameters alloc] initWithDictionary:@{    @1: @"size-42",    @2: @"color-black" }]; [[MappIntelligence shared] trackAction:actionEvent]; ``` > [!NOTE] > Event parameter numbers must match the custom event parameters configured in your Mapp Intelligence account. --- ## Related - [Quickstart](/v1/docs/mapp-intelligence-ios-sdk-v5-quickstart) - [Object Oriented Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-object-oriented-tracking) - [Pages](/v1/docs/mapp-intelligence-ios-sdk-v5-pages) - [Products and Orders](/v1/docs/mapp-intelligence-ios-sdk-v5-products-and-orders)