Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions contents/docs/product-analytics/autocapture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -409,20 +409,22 @@ PostHog captures the following events:

#### Configuring screen navigation autocapture

Screen navigation autocapture is not enabled by default. You can enable it by setting `captureScreenViews` to `true` in the config.
Screen navigation autocapture is **enabled by default**. You can disable it by setting `captureScreenViews` to `false` in the config.

| Option | Description |
| ----------------------------------- | ----------------------------------------------------------------------------------------------- |
| `captureScreenViews` | **Type:** `boolean`. When set to `true`, autocapture will capture screen views. |
| `captureApplicationLifecycleEvents` | **Type:** `boolean`. When set to `true`, autocapture will capture application lifecycle events. |
| Option | Description |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `captureScreenViews` | **Type:** `boolean`. **Default:** `true`. When `true`, autocapture will capture screen views (`$screen` events). |
| `captureApplicationLifecycleEvents` | **Type:** `boolean`. **Default:** `true`. When `true`, autocapture will capture application lifecycle events (`Application Installed` etc.). |
| `captureElementInteractions` | **Type:** `boolean`. **Default:** `false`. When `true`, autocapture will capture element interactions (iOS / Mac Catalyst only). |

For example, your initialization code might look like this:
For example, if you want to turn off the defaults and only enable element interactions, your initialization code might look like this:

```swift
let config = PostHogConfig(apiKey: <ph_project_token>, host: <ph_client_api_host>)

config.captureElementInteractions = true // Disabled by default
config.captureApplicationLifecycleEvents = true // Disabled by default
config.captureScreenViews = false // Enabled by default
config.captureApplicationLifecycleEvents = false // Enabled by default
config.captureElementInteractions = true // Disabled by default

PostHogSDK.shared.setup(config)
```
Expand Down