mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 00:55:37 +01:00
Referrer filtering.
This commit is contained in:
parent
65d4094095
commit
ebd52335bb
15 changed files with 158 additions and 54 deletions
|
|
@ -11,7 +11,7 @@ export default async (req, res) => {
|
|||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const { id, start_at, end_at, unit, tz, url } = req.query;
|
||||
const { id, start_at, end_at, unit, tz, url, ref } = req.query;
|
||||
|
||||
const websiteId = +id;
|
||||
const startDate = new Date(+start_at);
|
||||
|
|
@ -22,8 +22,11 @@ export default async (req, res) => {
|
|||
}
|
||||
|
||||
const [pageviews, sessions] = await Promise.all([
|
||||
getPageviewStats(websiteId, startDate, endDate, tz, unit, '*', url),
|
||||
getPageviewStats(websiteId, startDate, endDate, tz, unit, 'distinct session_id', url),
|
||||
getPageviewStats(websiteId, startDate, endDate, tz, unit, '*', { url, ref }),
|
||||
getPageviewStats(websiteId, startDate, endDate, tz, unit, 'distinct session_id', {
|
||||
url,
|
||||
ref,
|
||||
}),
|
||||
]);
|
||||
|
||||
return ok(res, { pageviews, sessions });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue