: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { formatUnitByQuantity } from 'scenes/experiments/utils'
import type { ExperimentMetric } from '~/queries/schema/schema-general'
import { FunnelConversionWindowTimeUnit } from '~/types'
export type MetricConversionWindowProps = {
metric: ExperimentMetric
}
export const MetricConversionWindow = ({ metric }: MetricConversionWindowProps): JSX.Element => {
if (metric.conversion_window != null && metric.conversion_window_unit) {
const unit = metric.conversion_window_unit || FunnelConversionWindowTimeUnit.Day
return (
<div className="text-xs">
<span className="text-muted">Conversion window:</span>{' '}
<span className="font-semibold">
{metric.conversion_window} {formatUnitByQuantity(metric.conversion_window, unit)}
</span>
</div>
)
}
return (
<div className="text-xs">
<span className="text-muted">Conversion window:</span>{' '}
<span className="font-semibold">Experiment duration</span>
</div>
)
}