From 0cd82d5eda96c0537c72dec7b9953769a72036dd Mon Sep 17 00:00:00 2001 From: "inkeep[bot]" <257615677+inkeep[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:47:04 +0000 Subject: [PATCH 1/3] docs(session-replay): add Android sampleRate config option Adds the sampleRate configuration option to the Android session replay installation snippet, reflecting the new sampling support added in Android SDK v3.34.0 (PR posthog/posthog#49047). --- .../session-replay/_snippets/android-installation.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contents/docs/session-replay/_snippets/android-installation.mdx b/contents/docs/session-replay/_snippets/android-installation.mdx index 030d8b213fd6..7aa5bf2f8e16 100644 --- a/contents/docs/session-replay/_snippets/android-installation.mdx +++ b/contents/docs/session-replay/_snippets/android-installation.mdx @@ -51,6 +51,15 @@ val config = PostHogAndroidConfig(apiKey = "").apply { // Ps: it was 500ms (0.5s) by default until version 3.8.2 // Available from version 3.10.0 (Before it was called debouncerDelayMs) sessionReplayConfig.throttleDelayMs = 1000 + + // Sample rate for session recordings. A value between 0.0 and 1.0. + // 1.0 means 100% of sessions will be recorded. 0.5 means 50%, and so on. + // Default is null (all sessions are recorded). + // + // Support for remote configuration + // in the session replay triggers (https://app.posthog.com/settings/project-replay#replay-triggers) + // requires SDK version 3.34.0 or higher. + sessionReplayConfig.sampleRate = null } ``` From e0079b628d8d978de5b308dcbe6e1a9b4389f256 Mon Sep 17 00:00:00 2001 From: "inkeep[bot]" <257615677+inkeep[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:47:58 +0000 Subject: [PATCH 2/3] docs(session-replay): Add iOS sampleRate config option for session recording sampling Reflects changes from PostHog/posthog#49047 which adds sampling support for iOS SDK v3.42.0+. The sampleRate option accepts a value between 0.0 and 1.0, with nil meaning all sessions are recorded. --- .../docs/session-replay/_snippets/ios-installation.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contents/docs/session-replay/_snippets/ios-installation.mdx b/contents/docs/session-replay/_snippets/ios-installation.mdx index 522cd2cc2a38..05d99f508d69 100644 --- a/contents/docs/session-replay/_snippets/ios-installation.mdx +++ b/contents/docs/session-replay/_snippets/ios-installation.mdx @@ -78,6 +78,15 @@ config.sessionReplayConfig.screenshotMode = true // A higher value reduces performance impact but decreases replay smoothness. Default is 1.0s. // Note: Previously known as `debouncerDelay` before version 3.21.0 config.sessionReplayConfig.throttleDelay = 1.0 + +// Sample rate for session recordings. A value between 0.0 and 1.0. +// 1.0 means 100% of sessions will be recorded. 0.5 means 50%, and so on. +// Default is nil (all sessions are recorded). +// +// Support for remote configuration +// in the session replay triggers (https://app.posthog.com/settings/project-replay#replay-triggers) +// requires SDK version 3.42.0 or higher. +config.sessionReplayConfig.sampleRate = 0.5 ``` ## Limitations From 5cf881aa0cfe9e3bce229f0645855b639f0521a1 Mon Sep 17 00:00:00 2001 From: "inkeep[bot]" <257615677+inkeep[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:50:04 +0000 Subject: [PATCH 3/3] docs: add mobile SDK sampling support for Android and iOS session replay Documents the new `sampleRate` config option for Android SDK (v3.34.0+) and iOS SDK (v3.42.0+) in the session recording controls page, matching PR #49047 in PostHog/posthog. --- ...w-to-control-which-sessions-you-record.mdx | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/contents/docs/session-replay/how-to-control-which-sessions-you-record.mdx b/contents/docs/session-replay/how-to-control-which-sessions-you-record.mdx index b0f2c97faae3..61f438ba8639 100644 --- a/contents/docs/session-replay/how-to-control-which-sessions-you-record.mdx +++ b/contents/docs/session-replay/how-to-control-which-sessions-you-record.mdx @@ -134,6 +134,44 @@ This means: > **Note:** Sampling reduces the number of sessions you record, but you cannot control which specific sessions are selected — the selection is determined by the session ID hash. +### Mobile SDK sampling + +Sampling is also available in the Android and iOS SDKs. You can set a sample rate directly in your SDK configuration: + + + + Android + iOS + + + + +```android_kotlin +val config = PostHogAndroidConfig(apiKey = "").apply { + sessionReplay = true + // Sample rate between 0.0 and 1.0. Default is null (all sessions recorded). + sessionReplayConfig.sampleRate = 0.5 // Record 50% of sessions +} +``` + +> **Note:** Requires Android SDK version 3.34.0 or higher. Remote configuration via [session replay triggers](https://app.posthog.com/settings/project-replay#replay-triggers) is also supported from this version. + + + + +```swift +let config = PostHogConfig(apiKey: "") +config.sessionReplay = true +// Sample rate between 0.0 and 1.0. Default is nil (all sessions recorded). +config.sessionReplayConfig.sampleRate = 0.5 // Record 50% of sessions +``` + +> **Note:** Requires iOS SDK version 3.42.0 or higher. Remote configuration via [session replay triggers](https://app.posthog.com/settings/project-replay#replay-triggers) is also supported from this version. + + + + + ## Combining controls Since version 1.238.0 of the web SDK you can control how multiple triggers are combined. Choosing whether recording will start when all triggers match or when any trigger matches.