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(web-analytics): gate session replay tile behind removal experiment (#70048)

Lucas Ricoy17c56b952a07
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index c535ede2aa4c..0d1e8918278a 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -528,6 +528,7 @@ export const FEATURE_FLAGS = {
WEB_ANALYTICS_PRECOMPUTE_TOGGLE: 'web-analytics-precompute-toggle', // owner: @lricoy #team-web-analytics
WEB_ANALYTICS_RECAP: 'web-analytics-recap', // owner: @jordanm-posthog #team-web-analytics
WEB_ANALYTICS_REGIONS_MAP: 'web-analytics-regions-map', // owner: @jordanm-posthog #team-web-analytics
+ WEB_ANALYTICS_REMOVE_REPLAY_TILE: 'web-analytics-remove-replay-tile', // owner: @lricoy #team-web-analytics multivariate=control,test
WEB_ANALYTICS_SESSION_PROPERTY_CHARTS: 'web-analytics-session-property-charts', // owner: @lricoy #team-web-analytics
WEB_ANALYTICS_SHARE_NUDGE_V2: 'web-analytics-share-nudge-v2', // owner: @jordanm-posthog #team-web-analytics multivariate=control,control_b,banner,export
WEB_ANALYTICS_STREAK_CADENCE: 'web-analytics-streak-cadence', // owner: @jordanm-posthog #team-web-analytics multivariate=control,hybrid,daily-only,weekly-only
diff --git a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx
index 481c2f91b853..08331ad80622 100644
--- a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx
+++ b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx
@@ -1381,6 +1381,15 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
const useTileHeaderV2 = featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_TILE_HEADER_V2] === 'test'
+ // Only read the removal experiment flag where the replay tile would actually render: the
+ // analytics tab with no conversion goal. allTiles is also built for the bot-analytics tab
+ // (then discarded), and the tile is hidden whenever a conversion goal is set, so reading the
+ // flag outside this path would enroll users neither variant affects and dilute the metrics.
+ const removeReplayTile =
+ productTab === ProductTab.ANALYTICS &&
+ !conversionGoal &&
+ featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_REMOVE_REPLAY_TILE] === 'test'
+
const includeHostMenuItem: LemonMenuItem | null =
useTileHeaderV2 && featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_INCLUDE_HOST]
? {
@@ -2343,7 +2352,7 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
},
}
: null,
- !conversionGoal
+ !conversionGoal && !removeReplayTile
? {
kind: 'replay',
tileId: TileId.REPLAY,