mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
Fixed bounce rate calc.
This commit is contained in:
parent
981bd40ff9
commit
ba5f1b3142
@ -41,6 +41,7 @@ export default function MetricsBar({ websiteId, className }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { pageviews, uniques, bounces, totaltime } = data || {};
|
const { pageviews, uniques, bounces, totaltime } = data || {};
|
||||||
|
const num = Math.min(uniques, bounces);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(styles.bar, className)} onClick={handleSetFormat}>
|
<div className={classNames(styles.bar, className)} onClick={handleSetFormat}>
|
||||||
@ -60,7 +61,7 @@ export default function MetricsBar({ websiteId, className }) {
|
|||||||
/>
|
/>
|
||||||
<MetricCard
|
<MetricCard
|
||||||
label={<FormattedMessage id="metrics.bounce-rate" defaultMessage="Bounce rate" />}
|
label={<FormattedMessage id="metrics.bounce-rate" defaultMessage="Bounce rate" />}
|
||||||
value={uniques ? (bounces / uniques) * 100 : 0}
|
value={uniques ? (num / uniques) * 100 : 0}
|
||||||
format={n => Number(n).toFixed(0) + '%'}
|
format={n => Number(n).toFixed(0) + '%'}
|
||||||
/>
|
/>
|
||||||
<MetricCard
|
<MetricCard
|
||||||
|
Loading…
Reference in New Issue
Block a user