mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 20:45:39 +01:00
Merge branch 'dev' into feat/um-202-event-data-new
This commit is contained in:
commit
da7f02bb73
38 changed files with 437 additions and 414 deletions
|
|
@ -50,7 +50,7 @@ async function relationalQuery(
|
|||
const { filterQuery, joinSession } = parseFilters(filters, params);
|
||||
|
||||
return rawQuery(
|
||||
`select ${getDateQuery('website_event.created_at', unit, timezone)} t,
|
||||
`select ${getDateQuery('website_event.created_at', unit, timezone)} x,
|
||||
count(${count !== '*' ? `${count}${sessionKey}` : count}) y
|
||||
from website_event
|
||||
${joinSession}
|
||||
|
|
@ -83,7 +83,7 @@ async function clickhouseQuery(
|
|||
|
||||
return rawQuery(
|
||||
`select
|
||||
${getDateStringQuery('g.t', unit)} as t,
|
||||
${getDateStringQuery('g.t', unit)} as x,
|
||||
g.y as y
|
||||
from
|
||||
(select
|
||||
|
|
|
|||
|
|
@ -8,8 +8,11 @@ import { uuid } from 'lib/crypto';
|
|||
export async function savePageView(args: {
|
||||
id: string;
|
||||
websiteId: string;
|
||||
url: string;
|
||||
referrer?: string;
|
||||
urlPath: string;
|
||||
urlQuery?: string;
|
||||
referrerPath?: string;
|
||||
referrerQuery?: string;
|
||||
referrerDomain?: string;
|
||||
pageTitle?: string;
|
||||
hostname?: string;
|
||||
browser?: string;
|
||||
|
|
@ -31,19 +34,34 @@ export async function savePageView(args: {
|
|||
async function relationalQuery(data: {
|
||||
id: string;
|
||||
websiteId: string;
|
||||
url: string;
|
||||
referrer?: string;
|
||||
urlPath: string;
|
||||
urlQuery?: string;
|
||||
referrerPath?: string;
|
||||
referrerQuery?: string;
|
||||
referrerDomain?: string;
|
||||
pageTitle?: string;
|
||||
}) {
|
||||
const { websiteId, id: sessionId, url, referrer, pageTitle } = data;
|
||||
const {
|
||||
websiteId,
|
||||
id: sessionId,
|
||||
urlPath,
|
||||
urlQuery,
|
||||
referrerPath,
|
||||
referrerQuery,
|
||||
referrerDomain,
|
||||
pageTitle,
|
||||
} = data;
|
||||
|
||||
return prisma.client.websiteEvent.create({
|
||||
data: {
|
||||
id: uuid(),
|
||||
websiteId,
|
||||
sessionId,
|
||||
url: url?.substring(0, URL_LENGTH),
|
||||
referrer: referrer?.substring(0, URL_LENGTH),
|
||||
urlPath: urlPath?.substring(0, URL_LENGTH),
|
||||
urlQuery: urlQuery?.substring(0, URL_LENGTH),
|
||||
referrerPath: referrerPath?.substring(0, URL_LENGTH),
|
||||
referrerQuery: referrerQuery?.substring(0, URL_LENGTH),
|
||||
referrerDomain: referrerDomain?.substring(0, URL_LENGTH),
|
||||
pageTitle: pageTitle,
|
||||
eventType: EVENT_TYPE.pageView,
|
||||
},
|
||||
|
|
@ -53,8 +71,11 @@ async function relationalQuery(data: {
|
|||
async function clickhouseQuery(data: {
|
||||
id: string;
|
||||
websiteId: string;
|
||||
url: string;
|
||||
referrer?: string;
|
||||
urlPath: string;
|
||||
urlQuery?: string;
|
||||
referrerPath?: string;
|
||||
referrerQuery?: string;
|
||||
referrerDomain?: string;
|
||||
pageTitle?: string;
|
||||
hostname?: string;
|
||||
browser?: string;
|
||||
|
|
@ -70,8 +91,11 @@ async function clickhouseQuery(data: {
|
|||
const {
|
||||
websiteId,
|
||||
id: sessionId,
|
||||
url,
|
||||
referrer,
|
||||
urlPath,
|
||||
urlQuery,
|
||||
referrerPath,
|
||||
referrerQuery,
|
||||
referrerDomain,
|
||||
pageTitle,
|
||||
country,
|
||||
subdivision1,
|
||||
|
|
@ -91,8 +115,11 @@ async function clickhouseQuery(data: {
|
|||
subdivision1: subdivision1 ? subdivision1 : null,
|
||||
subdivision2: subdivision2 ? subdivision2 : null,
|
||||
city: city ? city : null,
|
||||
url: url?.substring(0, URL_LENGTH),
|
||||
referrer: referrer?.substring(0, URL_LENGTH),
|
||||
urlPath: urlPath?.substring(0, URL_LENGTH),
|
||||
urlQuery: urlQuery?.substring(0, URL_LENGTH),
|
||||
referrerPath: referrerPath?.substring(0, URL_LENGTH),
|
||||
referrerQuery: referrerQuery?.substring(0, URL_LENGTH),
|
||||
referrerDomain: referrerDomain?.substring(0, URL_LENGTH),
|
||||
page_title: pageTitle,
|
||||
event_type: EVENT_TYPE.pageView,
|
||||
created_at: getDateFormat(new Date()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue