---
schema_version: "1"
id: adf7528dbfe1a9306543898417dcc86abd5a3719ef7f139acea24066b9f320af
title: Untitled
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/ios/agentforce-instrumentation-event-ios.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-instrumentation-event-ios.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a5fe45a51c3079b29b527738c2f6dddba7d0a2e18e0835e72a2079b12c33cfa6
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
## Overview

Represents different types of instrumentation events in the Agentforce SDK. This enumeration categorizes all the trackable events within the SDK, each carrying an EventInfo payload with specific details. The events cover the complete lifecycle of Agentforce interactions from initialization through conversation completion.

## Declaration

```swift
enum AgentforceInstrumentationEvent
```

## Properties

| Property                 | Type     | Description                                        |
| ------------------------ | -------- | -------------------------------------------------- |
| `recommendationClick`    | `String` | Static marker for recommendation click events.     |
| `recommendedActionClick` | `String` | Static marker for recommended action click events. |

## Methods

| Method                    | Signature                                            | Description                                                                   |
| ------------------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------- |
| `initializeAgentforce`    | `case initializeAgentforce(eventInfo: EventInfo)`    | Tracks the initialization and bootstrap process of the Agentforce SDK.        |
| `initializeAgents`        | `case initializeAgents(eventInfo: EventInfo)`        | Tracks the initialization and discovery of available agents.                  |
| `resetChat`               | `case resetChat(eventInfo: EventInfo)`               | Tracks conversation reset operations.                                         |
| `switchAgents`            | `case switchAgents(eventInfo: EventInfo)`            | Tracks agent switching during active conversations.                           |
| `initialResponseReceived` | `case initialResponseReceived(eventInfo: EventInfo)` | Tracks the time from user input until the first response content is received. |
| `finalResponseReceived`   | `case finalResponseReceived(eventInfo: EventInfo)`   | Tracks the complete response time from user input to final completion.        |
| `perfEvent`               | `case perfEvent(eventInfo: EventInfo)`               | Generic performance event for various system operations.                      |
| `userInteractionEvent`    | `case userInteractionEvent(eventInfo: EventInfo)`    | Tracks user interaction events throughout the interface.                      |
| `errorEvent`              | `case errorEvent(eventInfo: EventInfo)`              | Tracks error events across all SDK operations.                                |

## Example Usage

```swift
// Track initialization performance
let initEvent = AgentforceInstrumentationEvent.initializeAgentforce(
    eventInfo: EventInfo(
        name: "SDKBootstrap",
        startTime: startTime,
        endTime: endTime
    )
)

// Track user interactions
let userEvent = AgentforceInstrumentationEvent.userInteractionEvent(
    eventInfo: EventInfo(
        name: "MessageSent",
        properties: [
            EventInfoProperty.voiceOrText: "text",
            EventInfoProperty.messageId: messageId
        ]
    )
)
```
