Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

display + and - when value changes for bounce rate and session duration

Blue Mouse6648d9ba3cc9
diff --git a/app/pages/Project/View/components/MetricCards.tsx b/app/pages/Project/View/components/MetricCards.tsx
index fd1ac9629..edd0fd7de 100644
--- a/app/pages/Project/View/components/MetricCards.tsx
+++ b/app/pages/Project/View/components/MetricCards.tsx
@@ -164,14 +164,14 @@ const MetricCards = ({ overall, overallCompare, activePeriodCompare }: IMetricCa
change={_round(bounceRateChange as number, 1)}
type='percent'
goodChangeDirection='up'
- valueMapper={(value) => `${value}%`}
+ valueMapper={(value, type) => `${type === 'badge' && value > 0 ? '+' : ''}${value}%`}
/>
<MetricCard
label={t('dashboard.sessionDuration')}
value={overall.current?.sdur}
change={sdurChange}
goodChangeDirection='down'
- valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value))}
+ valueMapper={(value, type) => `${type === 'badge' && value > 0 ? '+' : ''}${getStringFromTime(getTimeFromSeconds(value))}`}
/>
</div>
)