mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
change referrers table from views to visitors
This commit is contained in:
parent
2df67fbad9
commit
4b3b9f1ee1
2 changed files with 8 additions and 6 deletions
|
|
@ -87,7 +87,7 @@ export function ReferrersTable({ allowFilter, ...props }: ReferrersTableProps) {
|
|||
{...props}
|
||||
title={formatMessage(labels.referrers)}
|
||||
type="referrer"
|
||||
metric={formatMessage(labels.views)}
|
||||
metric={formatMessage(labels.visitors)}
|
||||
dataFilter={view === 'grouped' ? groupedFilter : undefined}
|
||||
renderLabel={renderLink}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ async function relationalQuery(
|
|||
|
||||
return rawQuery(
|
||||
`
|
||||
select ${column} x, count(*) y
|
||||
select ${column} x,
|
||||
${column === 'referrer_domain' ? 'count(distinct session_id)' : 'count(*)'} as y
|
||||
from website_event
|
||||
${joinSession}
|
||||
${entryExitQuery}
|
||||
|
|
@ -119,7 +120,8 @@ async function clickhouseQuery(
|
|||
}
|
||||
|
||||
sql = `
|
||||
select ${column} x, count(*) y
|
||||
select ${column} x,
|
||||
${column === 'referrer_domain' ? 'uniq(session_id)' : 'count(*)'} as y
|
||||
from website_event
|
||||
${entryExitQuery}
|
||||
where website_id = {websiteId:UUID}
|
||||
|
|
@ -133,13 +135,13 @@ async function clickhouseQuery(
|
|||
`;
|
||||
} else {
|
||||
let groupByQuery = '';
|
||||
let columnQuery = `arrayJoin(${column})`;
|
||||
|
||||
if (column === 'referrer_domain') {
|
||||
excludeDomain = `and t != hostname and hostname != ''`;
|
||||
columnQuery = `session_id s, arrayJoin(${column})`;
|
||||
}
|
||||
|
||||
let columnQuery = `arrayJoin(${column})`;
|
||||
|
||||
if (type === 'entry') {
|
||||
columnQuery = `visit_id x, argMinMerge(entry_url)`;
|
||||
}
|
||||
|
|
@ -154,7 +156,7 @@ async function clickhouseQuery(
|
|||
|
||||
sql = `
|
||||
select g.t as x,
|
||||
count(*) as y
|
||||
${column === 'referrer_domain' ? 'uniq(s)' : 'count(*)'} as y
|
||||
from (
|
||||
select ${columnQuery} as t
|
||||
from website_event_stats_hourly website_event
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue