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.

feat(replay-vision): run the replay filters entry point as a control vs popover experiment (#128387)

Kim Svatos Dugan04f868010f01
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 503cc34eda44..3587e4cd5218 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -8906,6 +8906,10 @@ snapshots:
hash: v1.k794b7964.bc64e8d178e529d893d7bb7cf3b41acbc2f03932226becc2c3ab1122dfd2dcfd.VWUxbIzF0TqTKWX7VtcV_b1sxsM7WCMkHEaT9c0s2uQ
replay-tabs-home-filters-banner--scanner-cross-sell--light:
hash: v1.k794b7964.4ed70ddb8a2d3543d370f0bb7ef593c8ea519dc2d0f76211b3036803f76535b8.PKjFroml7V0bPXDpdHO4s52Xxxb--3lQmjldubsJzr0
+ replay-tabs-home-filters-banner--scanner-cross-sell-control--dark:
+ hash: v1.k794b7964.1722cfe8f847a40523bbbf5dd26dcb2ede8104f3c217746e520af470bf603696.zeYoi2mPsZ4krP8EVrYqmbbZwtJrWIzFkU1ZnYJNT8I
+ replay-tabs-home-filters-banner--scanner-cross-sell-control--light:
+ hash: v1.k794b7964.4ac8cd491bd7dd16dc3971687ae5543700a51aaa78f8479a9f22b787f6e39ddd.f40BCFR1yDV7Zle7lVyKtTRBrhetU8WZwdpYsIA35Ms
replay-tabs-home-filters-banner--templates-tab--dark:
hash: v1.k794b7964.d029de296a4c76b82cefbd0e68f9990c27a1b9692764a9b3ddc4317dd5d184d4.VGIKGjydwEuB3kz2DSDoMy-1QWQkGO6PPu44E4bBto0
replay-tabs-home-filters-banner--templates-tab--light:
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 4ad1f7b4f320..04ea97354614 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -579,6 +579,7 @@ export const FEATURE_FLAGS = {
UX_HIDE_PROJECT_NOTICE: 'ux-hide-project-notice', // owner: #team-platform-ux, hides the project notice banner across all scenes
UX_REMOVE_SIDEPANEL: 'ux-remove-sidepanel', // owner: #team-surveys
VISION_ENTRYPOINT_REPLAY_FILTERS: 'vision-entrypoint-replay-filters', // owner: #team-replay, cross-sell entry point from the replay filters panel
+ VISION_ENTRYPOINT_REPLAY_FILTERS_POPOVER: 'vision-entrypoint-replay-filters-popover', // owner: #team-replay multivariate=control,test, replay filters entry point experiment: control shows the "Create scanner" button that opens the wizard, test shows the AI popover
VISION_EXPERIMENT_SCANNER: 'experiment-scanner', // owner: #team-replay, experiment scanners overall: the type in the scanner editor, creating one from experiments, and the variants tab
VISION_SCANNER_WIZARD_RECORDINGS_FIRST: 'vision-scanner-wizard-recordings-first', // owner: #team-replay multivariate=control,test, new scanner wizard and goal overview ask which recordings to watch before the prompt; gate on === 'test'
VISUAL_REVIEW: 'visual-review', // owner: #team-devex
diff --git a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.stories.tsx b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.stories.tsx
index 86a3bea53152..149b4bc6d9fe 100644
--- a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.stories.tsx
+++ b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.stories.tsx
@@ -92,6 +92,14 @@ export const ScannerCrossSell: Story = {
},
}
+// The entry point experiment's control arm: the button that opens the wizard, with no popover.
+export const ScannerCrossSellControl: Story = {
+ parameters: {
+ ...ScannerCrossSell.parameters,
+ featureFlags: { [FEATURE_FLAGS.VISION_ENTRYPOINT_REPLAY_FILTERS_POPOVER]: 'control' },
+ },
+}
+
const withPageFilter = (values: Record<string, any>[]): Record<string, any> => ({
pageUrl: combineUrl(urls.replay(), {
showFilters: true,
diff --git a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx
index 85e2a51c7ac1..bd36b1b9bd11 100644
--- a/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx
+++ b/frontend/src/scenes/session-recordings/filters/RecordingsUniversalFiltersEmbed.tsx
@@ -58,7 +58,7 @@ import {
UniversalFiltersGroup,
} from '~/types'
-import { ReplayFiltersScannerButton } from 'products/replay_vision/frontend/replay_scanners/components/ReplayFiltersScannerButton'
+import { ReplayFiltersScannerEntryPoint } from 'products/replay_vision/frontend/replay_scanners/components/ReplayFiltersScannerEntryPoint'
import { scannerHandoffFromFilters } from 'products/replay_vision/frontend/replay_scanners/scannerHandoffFromFilters'
import { sessionRecordingSavedFiltersLogic } from '../filters/sessionRecordingSavedFiltersLogic'
@@ -571,7 +571,6 @@ export const ReplayFiltersTab = ({
const [isSaveFiltersModalOpen, setIsSaveFiltersModalOpen] = useState(false)
const showFeedbackButton = useFeatureFlag('SHOW_REPLAY_FILTERS_FEEDBACK_BUTTON')
- const scannerCrossSellEnabled = useFeatureFlag('VISION_ENTRYPOINT_REPLAY_FILTERS')
// A scanner keeps less of the filter set than this panel does, so what it would actually watch
// decides both the destination and whether the button is worth offering.
const scannerHandoff = useMemo(() => scannerHandoffFromFilters(filters), [filters])
@@ -881,14 +880,7 @@ export const ReplayFiltersTab = ({
</LemonButton>
)}
<div className="flex gap-2 ml-auto">
- {scannerCrossSellEnabled && (
- <>
- <ReplayFiltersScannerButton handoff={scannerHandoff} />
- {/* Grouped away from the buttons that act on the filters themselves:
- this one leaves for another product. */}
- <LemonDivider vertical className="mx-1 self-stretch" />
- </>
- )}
+ <ReplayFiltersScannerEntryPoint handoff={scannerHandoff} />
{resetButton}
<LemonButton
data-attr="filters-save-modal-open"
diff --git a/products/replay_vision/frontend/replay_scanners/components/ReplayFiltersScannerEntryPoint.tsx b/products/replay_vision/frontend/replay_scanners/components/ReplayFiltersScannerEntryPoint.tsx
new file mode 100644
index 000000000000..6976fa6a7392
--- /dev/null
+++ b/products/replay_vision/frontend/replay_scanners/components/ReplayFiltersScannerEntryPoint.tsx
@@ -0,0 +1,67 @@
+import { useActions, useValues } from 'kea'
+
+import { IconSparkles } from '@posthog/icons'
+import { LemonButton, LemonDivider } from '@posthog/lemon-ui'
+
+import { FEATURE_FLAGS } from 'lib/constants'
+import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+
+import { replayFiltersScannerLogic } from '../replayFiltersScannerLogic'
+import type { ScannerHandoffFromFilters } from '../scannerHandoffFromFilters'
+import { ReplayFiltersScannerButton } from './ReplayFiltersScannerButton'
+
+/** The Replay vision entry point in the replay filters footer. The team flag always shows the popover.
+ * Everyone else is in the entry point experiment: control gets the button that opens the wizard, test
+ * gets the popover. */
+export function ReplayFiltersScannerEntryPoint({
+ handoff,
+}: {
+ handoff: ScannerHandoffFromFilters
+}): JSX.Element | null {
+ const teamEntryPoint = useFeatureFlag('VISION_ENTRYPOINT_REPLAY_FILTERS')
+ const { featureFlags } = useValues(featureFlagLogic)
+
+ // Reading the experiment flag records the exposure, so it is read only here, where the entry point
+ // renders, and never for the team, who would otherwise count as exposed to an arm they do not see.
+ const arm = teamEntryPoint ? 'test' : featureFlags[FEATURE_FLAGS.VISION_ENTRYPOINT_REPLAY_FILTERS_POPOVER]
+ if (arm !== 'test' && arm !== 'control') {
+ return null
+ }
+
+ return (
+ <>
+ {arm === 'test' ? (
+ <ReplayFiltersScannerButton handoff={handoff} />
+ ) : (
+ <ReplayFiltersCreateScannerButton handoff={handoff} />
+ )}
+ {/* Grouped away from the buttons that act on the filters themselves: this one leaves for another product. */}
+ <LemonDivider vertical className="mx-1 self-stretch" />
+ </>
+ )
+}
+
+/** The control arm. Its own component so the scanner logic, and the quota requests its connected
+ * logic makes on mount, only start when a button renders. */
+function ReplayFiltersCreateScannerButton({ handoff }: { handoff: ScannerHandoffFromFilters }): JSX.Element {
+ const { createScanner } = useActions(replayFiltersScannerLogic)
+
+ return (
+ <LemonButton
+ type="secondary"
+ size="small"
+ icon={<IconSparkles className="text-ai" />}
+ // The same attr as the popover button, so autocapture compares the two arms.
+ data-attr="replay-save-filters-as-scanner"
+ tooltip={
+ handoff.narrowsSessions
+ ? 'Create a Replay vision scanner. It watches new session recordings that match these filters for you. The date range does not carry over, so it starts from now.'
+ : 'Create a Replay vision scanner. It watches every new session recording for you. Add a filter to watch only some of them. A date range and pinned sessions do not carry over.'
+ }
+ onClick={() => createScanner(handoff)}
+ >
+ Create scanner
+ </LemonButton>
+ )
+}
diff --git a/products/replay_vision/frontend/replay_scanners/replayFiltersScannerLogic.ts b/products/replay_vision/frontend/replay_scanners/replayFiltersScannerLogic.ts
index f27229fb529c..e2c853365d6a 100644
--- a/products/replay_vision/frontend/replay_scanners/replayFiltersScannerLogic.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayFiltersScannerLogic.ts
@@ -21,7 +21,10 @@ const MAX_CREDIT_CAP = 100_000_000
// Pinned: the `placement` on the shared replay_vision_upsell_* events and the scanner's `entry_point`.
export const REPLAY_FILTERS_ENTRY_POINT = 'replay_filters'
-function reportClicked(cta: 'open' | 'draft_with_ai' | 'set_up_manually', narrowsSessions?: boolean): void {
+function reportClicked(
+ cta: 'open' | 'draft_with_ai' | 'set_up_manually' | 'create_scanner',
+ narrowsSessions?: boolean
+): void {
posthog.capture('replay_vision_upsell_clicked', {
placement: REPLAY_FILTERS_ENTRY_POINT,
cta,
@@ -68,6 +71,9 @@ export interface replayFiltersScannerLogicActions {
handoff: ScannerHandoffFromFilters
spend: GoalDraftSpend
}
+ createScanner: (handoff: ScannerHandoffFromFilters) => {
+ handoff: ScannerHandoffFromFilters
+ }
draftWithAi: (
handoff: ScannerHandoffFromFilters,
spend?: GoalDraftSpend
@@ -125,6 +131,7 @@ export const replayFiltersScannerLogic = kea<replayFiltersScannerLogicType>([
setBudget: (budget: number | null) => ({ budget }),
draftWithAi: (handoff: ScannerHandoffFromFilters, spend?: GoalDraftSpend) => ({ handoff, spend }),
setUpManually: (handoff: ScannerHandoffFromFilters) => ({ handoff }),
+ createScanner: (handoff: ScannerHandoffFromFilters) => ({ handoff }),
requestConsent: (spend: GoalDraftSpend) => ({ spend }),
confirmConsent: (handoff: ScannerHandoffFromFilters, spend: GoalDraftSpend) => ({ handoff, spend }),
cancelConsent: true,
@@ -239,5 +246,11 @@ export const replayFiltersScannerLogic = kea<replayFiltersScannerLogicType>([
recordCrossSellIntent()
router.actions.push(manualWizardUrl(handoff))
},
+ // The entry point experiment's control: the button opens the wizard with no popover in between.
+ createScanner: ({ handoff }) => {
+ reportClicked('create_scanner', handoff.narrowsSessions)
+ recordCrossSellIntent()
+ router.actions.push(manualWizardUrl(handoff))
+ },
})),
])