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(experiments): move the wizard's metrics help into a heading tooltip (#108055)

ruby childsb77f98c2fb86
diff --git a/frontend/src/scenes/experiments/ExperimentForm/ExposureCriteriaPanel.tsx b/frontend/src/scenes/experiments/ExperimentForm/ExposureCriteriaPanel.tsx
index 9583faf5df3f..291a27a6b58d 100644
--- a/frontend/src/scenes/experiments/ExperimentForm/ExposureCriteriaPanel.tsx
+++ b/frontend/src/scenes/experiments/ExperimentForm/ExposureCriteriaPanel.tsx
@@ -1,6 +1,7 @@
import { useValues } from 'kea'
-import { LemonCollapse, LemonSelect, LemonTag } from '@posthog/lemon-ui'
+import { IconInfo } from '@posthog/icons'
+import { LemonButton, LemonCollapse, LemonSelect, LemonTag, Tooltip } from '@posthog/lemon-ui'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { TestAccountFilterSwitch } from 'lib/components/TestAccountFiltersSwitch'
@@ -261,8 +262,20 @@ export function ExposureCriteriaPanel({ experiment, onChange, compact }: Exposur
return (
<div className="space-y-4">
<div className="space-y-3">
- <div className="flex items-center justify-between gap-2">
- <span className="text-sm text-secondary">Include people when</span>
+ <div className="flex flex-wrap items-center justify-between gap-2">
+ <span className="flex items-center gap-1 whitespace-nowrap text-sm text-secondary">
+ Exposure event
+ <Tooltip title="People count toward the results once this event happens for them. By default, that's when your code checks the experiment's feature flag.">
+ <LemonButton
+ size="xsmall"
+ noPadding
+ icon={<IconInfo className="text-base text-secondary" />}
+ aria-label="About the exposure event"
+ data-attr="experiment-analytics-exposure-event-help"
+ className="shrink-0"
+ />
+ </Tooltip>
+ </span>
<LemonSelect
size="small"
dropdownMatchSelectWidth={false}
@@ -335,8 +348,20 @@ export function ExposureCriteriaPanel({ experiment, onChange, compact }: Exposur
{isActivation && <ActivationActionFilter experiment={experiment} onChange={onChange} />}
</div>
- <div className="flex items-center justify-between gap-2">
- <span className="text-sm text-secondary">Multiple variant handling</span>
+ <div className="flex flex-wrap items-center justify-between gap-2">
+ <span className="flex items-center gap-1 whitespace-nowrap text-sm text-secondary">
+ Multiple variant handling
+ <Tooltip title="Some people see more than one variant, for example after the split changes. Excluding them keeps the results clean. Using their first variant keeps them in, but can bias the results.">
+ <LemonButton
+ size="xsmall"
+ noPadding
+ icon={<IconInfo className="text-base text-secondary" />}
+ aria-label="About multiple variant handling"
+ data-attr="experiment-analytics-multiple-variant-handling-help"
+ className="shrink-0"
+ />
+ </Tooltip>
+ </span>
<LemonSelect
size="small"
dropdownMatchSelectWidth={false}
@@ -348,10 +373,10 @@ export function ExposureCriteriaPanel({ experiment, onChange, compact }: Exposur
options={[
{
value: 'exclude',
- label: 'Exclude multivariate users',
+ label: 'Exclude from analysis',
labelInMenu: (
<div>
- <div>Exclude multivariate users</div>
+ <div>Exclude from analysis</div>
<div className="text-xs text-muted font-normal">
Users exposed to multiple variants will be excluded (recommended)
</div>
@@ -361,10 +386,10 @@ export function ExposureCriteriaPanel({ experiment, onChange, compact }: Exposur
},
{
value: 'first_seen',
- label: 'First seen variant',
+ label: 'Use first seen variant',
labelInMenu: (
<div>
- <div>First seen variant</div>
+ <div>Use first seen variant</div>
<div className="text-xs text-muted font-normal">
Users will be analyzed using their first seen variant
</div>
diff --git a/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/EmptyMetricsPanel.tsx b/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/EmptyMetricsPanel.tsx
index a0a3f42e32e1..0bc614cad502 100644
--- a/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/EmptyMetricsPanel.tsx
+++ b/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/EmptyMetricsPanel.tsx
@@ -11,7 +11,12 @@ import { metricSourceModalLogic } from 'products/experiments/frontend/modals/Met
export const EmptyMetricsPanel = ({
helpText,
isLaunched,
-}: { helpText?: string; isLaunched?: boolean } = {}): JSX.Element => {
+ showHelpText = true,
+}: {
+ helpText?: string
+ isLaunched?: boolean
+ showHelpText?: boolean
+} = {}): JSX.Element => {
const { openMetricSourceModal } = useActions(metricSourceModalLogic)
return (
@@ -55,7 +60,7 @@ export const EmptyMetricsPanel = ({
</div>
</LemonButton>
</div>
- {!isLaunched && (
+ {!isLaunched && showHelpText && (
<div className="max-w-md">
<p className="text-xs text-muted">
{helpText ??
diff --git a/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/MetricsPanel.tsx b/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/MetricsPanel.tsx
index 29fab8ef7ad4..4e799fb5214f 100644
--- a/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/MetricsPanel.tsx
+++ b/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/MetricsPanel.tsx
@@ -69,7 +69,8 @@ export const MetricsPanel = ({
)}
{primaryMetrics.length === 0 && secondaryMetrics.length === 0 ? (
- <EmptyMetricsPanel />
+ // In compact mode (the wizard) the step heading's tooltip carries this help text
+ <EmptyMetricsPanel showHelpText={!compact} />
) : (
<div className="space-y-6">
<MetricList
diff --git a/frontend/src/scenes/experiments/ExperimentWizard/steps/AnalyticsStep.tsx b/frontend/src/scenes/experiments/ExperimentWizard/steps/AnalyticsStep.tsx
index 2a7e7d345e72..7f8229529307 100644
--- a/frontend/src/scenes/experiments/ExperimentWizard/steps/AnalyticsStep.tsx
+++ b/frontend/src/scenes/experiments/ExperimentWizard/steps/AnalyticsStep.tsx
@@ -1,7 +1,8 @@
import { useActions, useValues } from 'kea'
import { useState } from 'react'
-import { LemonBanner, LemonCheckbox } from '@posthog/lemon-ui'
+import { IconInfo } from '@posthog/icons'
+import { LemonButton, LemonCheckbox, Tooltip } from '@posthog/lemon-ui'
import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
@@ -27,7 +28,18 @@ export function AnalyticsStep(): JSX.Element {
</div>
<div className="mt-10">
- <h3 className="text-lg font-semibold mb-1">How to measure impact?</h3>
+ <h3 className="text-lg font-semibold mb-1 flex items-center gap-1">
+ How to measure impact?
+ <Tooltip title="Add metrics to measure your experiment's impact. You can add them before or after launching.">
+ <LemonButton
+ size="xsmall"
+ noPadding
+ icon={<IconInfo className="text-base text-secondary" />}
+ aria-label="About measuring impact"
+ data-attr="experiment-analytics-metrics-help"
+ />
+ </Tooltip>
+ </h3>
<MetricsPanel
experiment={experiment}
sharedMetrics={sharedMetrics}
@@ -81,10 +93,6 @@ export function AnalyticsStep(): JSX.Element {
</div>
<ReplayVisionScannerCheckbox />
-
- <LemonBanner type="info">
- You can always refine your analytics configuration and metrics after saving.
- </LemonBanner>
</div>
)
}
diff --git a/products/experiments/skills/configuring-experiment-analytics/SKILL.md b/products/experiments/skills/configuring-experiment-analytics/SKILL.md
index cc364586b554..79c98ba53d3b 100644
--- a/products/experiments/skills/configuring-experiment-analytics/SKILL.md
+++ b/products/experiments/skills/configuring-experiment-analytics/SKILL.md
@@ -1,6 +1,6 @@
---
name: configuring-experiment-analytics
-description: Configures the analytics side of a PostHog experiment — exposure criteria (server-resolved default exposure event vs custom exposure events), primary and secondary metrics, the supported metric types (count, sum, ratio with `math` and `math_property`, retention with `retention_window_start` and `start_handling`), multivariate user handling ("Exclude" vs "First seen variant"), and how to read results once the experiment is live. Use when the user adds or edits a primary or secondary metric (e.g. "add a secondary metric tracking 'downloaded_file' per user"), sets up a ratio metric (e.g. "revenue from purchase_completed / pageviews"), sets up a retention metric (e.g. "$pageview → uploaded_file, 7-day window"), configures custom exposure (e.g. "only count users who hit /checkout"), changes multivariate handling, or asks "who is in the analysis?", "how do I measure impact?", "is this winning?", "what's the confidence level?", or "should I ship?".
+description: Configures the analytics side of a PostHog experiment — exposure criteria (server-resolved default exposure event vs custom exposure events), primary and secondary metrics, the supported metric types (count, sum, ratio with `math` and `math_property`, retention with `retention_window_start` and `start_handling`), multivariate user handling ("Exclude from analysis" vs "Use first seen variant"), and how to read results once the experiment is live. Use when the user adds or edits a primary or secondary metric (e.g. "add a secondary metric tracking 'downloaded_file' per user"), sets up a ratio metric (e.g. "revenue from purchase_completed / pageviews"), sets up a retention metric (e.g. "$pageview → uploaded_file, 7-day window"), configures custom exposure (e.g. "only count users who hit /checkout"), changes multivariate handling, or asks "who is in the analysis?", "how do I measure impact?", "is this winning?", "what's the confidence level?", or "should I ship?".
---
# Configuring experiment analytics
@@ -11,7 +11,7 @@ This skill answers: **Who is included in the analysis?** and **How to measure im
Exposure criteria determine which users are counted in the experiment analysis.
-### Include people when
+### Exposure event
Two options:
@@ -22,11 +22,11 @@ Two options:
When a user is exposed to multiple variants (e.g., due to flag changes or race conditions):
-- **Exclude multivariate users** — removes these users from the analysis entirely. Cleaner data, smaller sample.
-- **First seen variant** — assigns users to the first variant they were exposed to. Keeps all users in the analysis. Note that "first seen" can introduce other biases as
+- **Exclude from analysis** — removes these users from the analysis entirely. Cleaner data, smaller sample.
+- **Use first seen variant** — assigns users to the first variant they were exposed to. Keeps all users in the analysis. Note that "first seen" can introduce other biases as
behavior cannot be clearly attributed to a single variant and is not recommended unless necessary.
-**Bias risk on uneven splits.** "Exclude multivariate users" combined with an uneven variant split can
+**Bias risk on uneven splits.** "Exclude from analysis" combined with an uneven variant split can
introduce bias — multi-variant users are dropped asymmetrically and the smaller variant loses a larger
fraction of its assignments. If those users behave differently from the rest, the smaller variant's
metrics will be skewed.
@@ -37,8 +37,8 @@ The right mitigation depends on experiment state:
use the overall rollout percentage to limit test-variant exposure. This removes the bias and
preserves statistical power. See `configuring-experiment-rollout`.
- **Live experiment with significant exposures** — changing the split mid-run reassigns users across
- variants, which is bad for user experience and data quality. Switch this setting to "First seen
- variant" instead — it keeps already-assigned users in their original variant (no reassignment) and
+ variants, which is bad for user experience and data quality. Switch this setting to "Use first
+ seen variant" instead — it keeps already-assigned users in their original variant (no reassignment) and
removes the asymmetric exclusion.
### Filter test accounts
diff --git a/products/experiments/skills/configuring-experiment-rollout/SKILL.md b/products/experiments/skills/configuring-experiment-rollout/SKILL.md
index b77f48402f0b..f420baf6d019 100644
--- a/products/experiments/skills/configuring-experiment-rollout/SKILL.md
+++ b/products/experiments/skills/configuring-experiment-rollout/SKILL.md
@@ -21,7 +21,7 @@ Always default to an equal split unless the user explicitly requests otherwise.
## When an uneven split is required
-Uneven splits combined with the default "Exclude multivariate users" handling can introduce bias.
+Uneven splits combined with the default "Exclude from analysis" handling can introduce bias.
If the experiment observes multi-variant users (users exposed to more than one variant) then those are
dropped asymmetrically — the smaller variant loses a larger fraction of its assignments. If those users
behave differently from the rest, the smaller variant's metrics will be skewed.
@@ -146,13 +146,13 @@ the riskier rollout path and needs to make an informed choice about how to mitig
Ask:
-> One more thing — with an uneven split, the default "Exclude multivariate users" handling drops
+> One more thing — with an uneven split, the default "Exclude from analysis" handling drops
> users exposed to multiple variants asymmetrically. The smaller variant loses a larger fraction of
> its assignments, which can skew its metrics if those users behave differently from the rest.
>
> Two options:
>
-> 1. **Switch multivariate handling to "First seen variant"** (recommended for uneven splits) —
+> 1. **Switch multivariate handling to "Use first seen variant"** (recommended for uneven splits) —
> keeps all users in the analysis and avoids asymmetric exclusion. Has its own caveats (other
> biases can creep in) but is preferable to the default for uneven splits.
> 2. **Keep the default "Exclude" handling** and accept the bias risk.
diff --git a/products/experiments/skills/configuring-experiment-rollout/references/changing-distribution-after-launch.md b/products/experiments/skills/configuring-experiment-rollout/references/changing-distribution-after-launch.md
index de52e5c073b6..0b5610a5a549 100644
--- a/products/experiments/skills/configuring-experiment-rollout/references/changing-distribution-after-launch.md
+++ b/products/experiments/skills/configuring-experiment-rollout/references/changing-distribution-after-launch.md
@@ -39,8 +39,8 @@ Example: 50/50 split → 80/20 A/B split.
**Analysis**: Users who experienced B and are now in A have behavior that can't be cleanly attributed to either variant — this is bias. PostHog handles this with two options:
-- **Exclude multivariate users** (default, recommended) — removes these users from the analysis. Cleaner data but fewer data points, meaning longer time to reach reliable results.
-- **First seen variant** — keeps all users, attributes them to their first variant. More data but noisier.
+- **Exclude from analysis** (default, recommended) — removes these users from the analysis. Cleaner data but fewer data points, meaning longer time to reach reliable results.
+- **Use first seen variant** — keeps all users, attributes them to their first variant. More data but noisier.
**Warning to present**: