Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

docs(surveys): add Android surveys onboarding content (#62288)

Ioannis J03448a6d6785
diff --git a/docs/onboarding/surveys/android.tsx b/docs/onboarding/surveys/android.tsx
new file mode 100644
index 000000000000..891f1c8d8846
--- /dev/null
+++ b/docs/onboarding/surveys/android.tsx
@@ -0,0 +1,86 @@
+import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/OnboardingDocsContentWrapper'
+
+import { getAndroidSteps } from '../product-analytics/android'
+import { StepDefinition } from '../steps'
+
+function getSurveysAndroidSteps(ctx: OnboardingComponentsContext): StepDefinition[] {
+ const { CodeBlock, Markdown, dedent, snippets } = ctx
+ const SurveysFinalSteps = snippets?.SurveysFinalSteps
+
+ const installationSteps = getAndroidSteps(ctx)
+
+ const surveysSteps: StepDefinition[] = [
+ {
+ title: 'Add the surveys UI module',
+ badge: 'required',
+ content: (
+ <>
+ <Markdown>
+ {dedent`
+ Add the optional \`posthog-android-surveys-compose\` module alongside the core SDK. It
+ provides a ready-made [Jetpack Compose](https://developer.android.com/jetpack/compose) UI.
+ `}
+ </Markdown>
+ <CodeBlock
+ blocks={[
+ {
+ language: 'kotlin',
+ file: 'build.gradle',
+ code: dedent`
+ dependencies {
+ // ... existing dependencies
+ implementation("com.posthog:posthog-android-surveys-compose:0.+")
+ }
+ `,
+ },
+ ]}
+ />
+ </>
+ ),
+ },
+ {
+ title: 'Enable surveys in your configuration',
+ badge: 'required',
+ content: (
+ <>
+ <Markdown>
+ {dedent`
+ Enable surveys in your PostHog configuration. The SDK auto-discovers the UI module from the
+ classpath, so matching surveys render automatically with no extra wiring.
+ `}
+ </Markdown>
+ <CodeBlock
+ blocks={[
+ {
+ language: 'kotlin',
+ file: 'SampleApp.kt',
+ code: dedent`
+ val config = PostHogAndroidConfig(
+ apiKey = POSTHOG_PROJECT_TOKEN,
+ host = POSTHOG_HOST
+ ).apply {
+ surveys = true
+ }
+
+ PostHogAndroid.setup(appContext, config)
+ `,
+ },
+ ]}
+ />
+ </>
+ ),
+ },
+ ]
+
+ return [
+ ...installationSteps,
+ ...surveysSteps,
+ {
+ title: 'Next steps',
+ badge: 'recommended',
+ content: <>{SurveysFinalSteps && <SurveysFinalSteps />}</>,
+ },
+ ]
+}
+
+export const SurveysAndroidInstallation = createInstallation(getSurveysAndroidSteps)
diff --git a/docs/onboarding/surveys/index.ts b/docs/onboarding/surveys/index.ts
index f089ef3f86a0..ab544e8f4147 100644
--- a/docs/onboarding/surveys/index.ts
+++ b/docs/onboarding/surveys/index.ts
@@ -1,5 +1,6 @@
export { SurveysFinalSteps } from './_snippets/surveys-final-steps'
+export { SurveysAndroidInstallation } from './android'
export { SurveysAngularInstallation } from './angular'
export { SurveysAstroInstallation } from './astro'
export { SurveysBubbleInstallation } from './bubble'
diff --git a/docs/published/docs/surveys/sdk-feature-support.mdx b/docs/published/docs/surveys/sdk-feature-support.mdx
index 827d0452535d..86ab3c3295a1 100644
--- a/docs/published/docs/surveys/sdk-feature-support.mdx
+++ b/docs/published/docs/surveys/sdk-feature-support.mdx
@@ -25,11 +25,11 @@ For setup instructions, see the [installation guides](/docs/surveys/installation
| Event trigger property filters | <IconCheck className="w-4 h-4 inline text-green" /> 1.268.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 4.16.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.47.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.38.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 5.20.0+ |
| Cancellation events | <IconCheck className="w-4 h-4 inline text-green" /> 1.299.0+ | <a href="https://github.com/PostHog/posthog-js/issues/2964"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-ios/issues/450"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-android/issues/393"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-flutter/issues/264"><IconWrench className="w-4 h-4 inline text-muted" /></a> |
| Targeting with actions | <IconCheck className="w-4 h-4 inline text-green" /> 1.301.0+ | <a href="https://github.com/PostHog/posthog-js/issues/2965"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-ios/issues/451"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-android/issues/394"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-flutter/issues/265"><IconWrench className="w-4 h-4 inline text-muted" /></a> |
-| Styling input appearance | <IconCheck className="w-4 h-4 inline text-green" /> 1.300.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 4.15.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.38.0+ | <IconX className="w-4 h-4 inline text-red" /> | <IconCheck className="w-4 h-4 inline text-green" /> 5.13.0+ |
-| Custom text colors | <IconCheck className="w-4 h-4 inline text-green" /> 1.310.1+ | <IconCheck className="w-4 h-4 inline text-green" /> 4.17.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.38.0+ | <IconX className="w-4 h-4 inline text-red" /> | <IconCheck className="w-4 h-4 inline text-green" /> 5.13.0+ |
-| Thumbs up/down question | <IconCheck className="w-4 h-4 inline text-green" /> 1.326.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 4.19.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.38.0+ | <IconX className="w-4 h-4 inline text-red" /> | <IconCheck className="w-4 h-4 inline text-green" /> 5.13.0+ |
+| Styling input appearance | <IconCheck className="w-4 h-4 inline text-green" /> 1.300.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 4.15.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.38.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.49.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 5.13.0+ |
+| Custom text colors | <IconCheck className="w-4 h-4 inline text-green" /> 1.310.1+ | <IconCheck className="w-4 h-4 inline text-green" /> 4.17.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.38.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.49.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 5.13.0+ |
+| Thumbs up/down question | <IconCheck className="w-4 h-4 inline text-green" /> 1.326.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 4.19.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.38.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.49.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 5.13.0+ |
| Shuffle questions | <IconCheck className="w-4 h-4 inline text-green" /> 1.131.5+ | <a href="https://github.com/PostHog/posthog-js/issues/3162"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-ios/issues/492"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-android/issues/442"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-flutter/issues/310"><IconWrench className="w-4 h-4 inline text-muted" /></a> |
| Shuffle choice options | <IconCheck className="w-4 h-4 inline text-green" /> 1.131.5+ | <a href="https://github.com/PostHog/posthog-js/issues/3162"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-ios/issues/492"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <IconX className="w-4 h-4 inline text-red" /> | <a href="https://github.com/PostHog/posthog-flutter/issues/310"><IconWrench className="w-4 h-4 inline text-muted" /></a> |
| Survey wait period | <IconCheck className="w-4 h-4 inline text-green" /> 1.105.7+ | <a href="https://github.com/PostHog/posthog-js/issues/3192"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <IconCheck className="w-4 h-4 inline text-green" /> 3.44.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.35.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 5.18.0+ |
-| Delay survey popup | <IconCheck className="w-4 h-4 inline text-green" /> 1.141.0+ | <a href="https://github.com/PostHog/posthog-js/issues/3193"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <IconCheck className="w-4 h-4 inline text-green" /> 3.54.0+ | <a href="https://github.com/PostHog/posthog-android/issues/448"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <a href="https://github.com/PostHog/posthog-flutter/issues/322"><IconWrench className="w-4 h-4 inline text-muted" /></a> |
+| Delay survey popup | <IconCheck className="w-4 h-4 inline text-green" /> 1.141.0+ | <a href="https://github.com/PostHog/posthog-js/issues/3193"><IconWrench className="w-4 h-4 inline text-muted" /></a> | <IconCheck className="w-4 h-4 inline text-green" /> 3.54.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 3.49.0+ | <a href="https://github.com/PostHog/posthog-flutter/issues/322"><IconWrench className="w-4 h-4 inline text-muted" /></a> |
| Response length validation | <IconCheck className="w-4 h-4 inline text-green" /> 1.344.0+ | <IconCheck className="w-4 h-4 inline text-green" /> 4.31.0+ | <IconX className="w-4 h-4 inline text-red" /> | <IconX className="w-4 h-4 inline text-red" /> | <IconX className="w-4 h-4 inline text-red" /> |
diff --git a/frontend/src/scenes/surveys/surveyVersionRequirements.ts b/frontend/src/scenes/surveys/surveyVersionRequirements.ts
index 06df48c2b1f5..569ac81f2842 100644
--- a/frontend/src/scenes/surveys/surveyVersionRequirements.ts
+++ b/frontend/src/scenes/surveys/surveyVersionRequirements.ts
@@ -233,11 +233,10 @@ export const SURVEY_SDK_REQUIREMENTS: SurveyFeatureRequirement[] = [
'posthog-js': '1.300.0',
'posthog-react-native': '4.15.0',
'posthog-ios': '3.38.0',
+ 'posthog-android': '3.49.0', // via posthog-android-surveys-compose UI module
posthog_flutter: '5.13.0',
},
- unsupportedSdks: [
- { sdk: 'posthog-android', issue: false }, // delegate pattern - no built-in UI
- ],
+ unsupportedSdks: [],
check: (s) => s.appearance?.inputBackground !== undefined || s.appearance?.inputTextColor !== undefined,
},
{
@@ -246,11 +245,10 @@ export const SURVEY_SDK_REQUIREMENTS: SurveyFeatureRequirement[] = [
'posthog-js': '1.310.1',
'posthog-react-native': '4.17.0',
'posthog-ios': '3.38.0',
+ 'posthog-android': '3.49.0', // via posthog-android-surveys-compose UI module
posthog_flutter: '5.13.0',
},
- unsupportedSdks: [
- { sdk: 'posthog-android', issue: false }, // delegate pattern - no built-in UI
- ],
+ unsupportedSdks: [],
check: (s) => s.appearance?.textColor !== undefined || s.appearance?.submitButtonTextColor !== undefined,
},
{
@@ -259,11 +257,10 @@ export const SURVEY_SDK_REQUIREMENTS: SurveyFeatureRequirement[] = [
'posthog-js': '1.326.0',
'posthog-react-native': '4.19.0',
'posthog-ios': '3.38.0',
+ 'posthog-android': '3.49.0', // via posthog-android-surveys-compose UI module
posthog_flutter: '5.13.0',
},
- unsupportedSdks: [
- { sdk: 'posthog-android', issue: false }, // delegate pattern - no built-in UI
- ],
+ unsupportedSdks: [],
check: (s) =>
s.questions.some(
(q) => q.type === SurveyQuestionType.Rating && q.scale === SURVEY_RATING_SCALE.THUMB_2_POINT
@@ -312,10 +309,10 @@ export const SURVEY_SDK_REQUIREMENTS: SurveyFeatureRequirement[] = [
sdkVersions: {
'posthog-js': '1.141.0',
'posthog-ios': '3.54.0',
+ 'posthog-android': '3.49.0',
},
unsupportedSdks: [
{ sdk: 'posthog-react-native', issue: 'https://github.com/PostHog/posthog-js/issues/3193' },
- { sdk: 'posthog-android', issue: 'https://github.com/PostHog/posthog-android/issues/448' },
{ sdk: 'posthog_flutter', issue: 'https://github.com/PostHog/posthog-flutter/issues/322' },
],
check: (s) => (s.appearance?.surveyPopupDelaySeconds ?? 0) > 0,