mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 05:07:15 +01:00
Cohort selection.
This commit is contained in:
parent
05f9a67727
commit
bab4f8ebcc
32 changed files with 841 additions and 655 deletions
|
|
@ -40,8 +40,8 @@ async function relationalQuery(
|
|||
): Promise<AttributionResult> {
|
||||
const { model, type, currency } = parameters;
|
||||
const { rawQuery, parseFilters } = prisma;
|
||||
const eventType = type === 'page' ? EVENT_TYPE.pageView : EVENT_TYPE.customEvent;
|
||||
const column = type === 'page' ? 'url_path' : 'event_name';
|
||||
const eventType = type === 'path' ? EVENT_TYPE.pageView : EVENT_TYPE.customEvent;
|
||||
const column = type === 'path' ? 'url_path' : 'event_name';
|
||||
const { filterQuery, joinSessionQuery, cohortQuery, queryParams } = parseFilters({
|
||||
...filters,
|
||||
...parameters,
|
||||
|
|
@ -266,8 +266,8 @@ async function clickhouseQuery(
|
|||
): Promise<AttributionResult> {
|
||||
const { model, type, currency } = parameters;
|
||||
const { rawQuery, parseFilters } = clickhouse;
|
||||
const eventType = type === 'page' ? EVENT_TYPE.pageView : EVENT_TYPE.customEvent;
|
||||
const column = type === 'page' ? 'url_path' : 'event_name';
|
||||
const eventType = type === 'path' ? EVENT_TYPE.pageView : EVENT_TYPE.customEvent;
|
||||
const column = type === 'path' ? 'url_path' : 'event_name';
|
||||
const { filterQuery, cohortQuery, queryParams } = parseFilters({
|
||||
...filters,
|
||||
...parameters,
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ async function relationalQuery(
|
|||
(pv, cv, i) => {
|
||||
const levelNumber = i + 1;
|
||||
const startSum = i > 0 ? 'union ' : '';
|
||||
const isURL = cv.type === 'page';
|
||||
const isURL = cv.type === 'path';
|
||||
const column = isURL ? 'url_path' : 'event_name';
|
||||
|
||||
let operator = '=';
|
||||
|
|
@ -161,7 +161,7 @@ async function clickhouseQuery(
|
|||
const levelNumber = i + 1;
|
||||
const startSum = i > 0 ? 'union all ' : '';
|
||||
const startFilter = i > 0 ? 'or' : '';
|
||||
const isURL = cv.type === 'page';
|
||||
const isURL = cv.type === 'path';
|
||||
const column = isURL ? 'url_path' : 'event_name';
|
||||
|
||||
let operator = '=';
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ async function relationalQuery(
|
|||
) {
|
||||
const { startDate, endDate, type, value } = parameters;
|
||||
const { rawQuery, parseFilters } = prisma;
|
||||
const eventType = type === 'page' ? EVENT_TYPE.pageView : EVENT_TYPE.customEvent;
|
||||
const column = type === 'page' ? 'url_path' : 'event_name';
|
||||
const eventType = type === 'path' ? EVENT_TYPE.pageView : EVENT_TYPE.customEvent;
|
||||
const column = type === 'path' ? 'url_path' : 'event_name';
|
||||
const { filterQuery, dateQuery, joinSessionQuery, cohortQuery, queryParams } = parseFilters({
|
||||
...filters,
|
||||
websiteId,
|
||||
|
|
@ -71,8 +71,8 @@ async function clickhouseQuery(
|
|||
) {
|
||||
const { startDate, endDate, type, value } = parameters;
|
||||
const { rawQuery, parseFilters } = clickhouse;
|
||||
const eventType = type === 'page' ? EVENT_TYPE.pageView : EVENT_TYPE.customEvent;
|
||||
const column = type === 'page' ? 'url_path' : 'event_name';
|
||||
const eventType = type === 'path' ? EVENT_TYPE.pageView : EVENT_TYPE.customEvent;
|
||||
const column = type === 'path' ? 'url_path' : 'event_name';
|
||||
const { filterQuery, dateQuery, cohortQuery, queryParams } = parseFilters({
|
||||
...filters,
|
||||
websiteId,
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters) {
|
|||
${getDateStringSQL('min(created_at)')} as firstAt,
|
||||
${getDateStringSQL('max(created_at)')} as lastAt,
|
||||
uniq(visit_id) as visits,
|
||||
sumIf(views, event_type = 1) as views,
|
||||
sumIf(1, event_type = 1) as views,
|
||||
lastAt as createdAt
|
||||
from website_event
|
||||
${cohortQuery}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue