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

# Log App Events and Listen for Candid SDK Callbacks

> Forward your app's analytics events to Candid so it can detect task completion.

Candid uses event names to detect when a user has completed an action task during a research session. You forward those events by calling `Candid.log(_:)`, and you receive SDK-internal lifecycle events, such as when a session starts or ends, by setting `Candid.eventHandler`. Both APIs are optional but together they give you full observability over the research flow.

## Logging events for task matching

When the match occurs during an active recording session, Candid marks that task as complete and advances to the next step. Call `Candid.log(_:)` with the same event name you used when creating the task in the dashboard:

```swift theme={null}
func userDidFollowArtist(_ artist: Artist) {
    analytics.track("app_follow_artist")
    Candid.log("app_follow_artist")
}
```

<Tip>
  Place each `Candid.log` call right next to your existing analytics tracking call. That way the two stay in sync when you rename events, and there is no extra instrumentation to maintain.
</Tip>

<Note>
  `Candid.log(_:)` is a no-op outside of an active recording session. It is safe to call at any time,  you do not need to gate it behind a session check.
</Note>
