mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 23:33:37 +01:00
Fixed bounce rate calculation.
This commit is contained in:
parent
1591dc246c
commit
a19248d713
@ -35,7 +35,7 @@ export default function MetricsBar({ websiteId, startDate, endDate, className })
|
|||||||
<MetricCard label="Visitors" value={uniques} format={formatFunc} />
|
<MetricCard label="Visitors" value={uniques} format={formatFunc} />
|
||||||
<MetricCard
|
<MetricCard
|
||||||
label="Bounce rate"
|
label="Bounce rate"
|
||||||
value={uniques ? (bounces / uniques) * 100 : 0}
|
value={pageviews ? (bounces / pageviews) * 100 : 0}
|
||||||
format={n => Number(n).toFixed(0) + '%'}
|
format={n => Number(n).toFixed(0) + '%'}
|
||||||
/>
|
/>
|
||||||
<MetricCard
|
<MetricCard
|
||||||
|
@ -236,7 +236,7 @@ export function getMetrics(website_id, start_at, end_at) {
|
|||||||
`
|
`
|
||||||
select sum(t.c) as "pageviews",
|
select sum(t.c) as "pageviews",
|
||||||
count(distinct t.session_id) as "uniques",
|
count(distinct t.session_id) as "uniques",
|
||||||
sum(case when t.c = 1 then t.c else 0 end) as "bounces",
|
sum(case when t.c = 1 then 1 else 0 end) as "bounces",
|
||||||
sum(t.time) as "totaltime"
|
sum(t.time) as "totaltime"
|
||||||
from (
|
from (
|
||||||
select session_id,
|
select session_id,
|
||||||
@ -260,7 +260,7 @@ export function getMetrics(website_id, start_at, end_at) {
|
|||||||
`
|
`
|
||||||
select sum(t.c) as "pageviews",
|
select sum(t.c) as "pageviews",
|
||||||
count(distinct t.session_id) as "uniques",
|
count(distinct t.session_id) as "uniques",
|
||||||
sum(case when t.c = 1 then t.c else 0 end) as "bounces",
|
sum(case when t.c = 1 then 1 else 0 end) as "bounces",
|
||||||
sum(t.time) as "totaltime"
|
sum(t.time) as "totaltime"
|
||||||
from (
|
from (
|
||||||
select session_id,
|
select session_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user