Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix utm request

biqettec8302390c52d
diff --git a/queries/analytics/pageview/getPageviewParams.js b/queries/analytics/pageview/getPageviewParams.js
index fd25c77e5..6b505529c 100644
--- a/queries/analytics/pageview/getPageviewParams.js
+++ b/queries/analytics/pageview/getPageviewParams.js
@@ -9,7 +9,7 @@ export async function getPageviewParams(...args) {
}
function relationalQuery(param, website_id, start_at, end_at, column, table, filters = {}) {
- const params = [param, website_id, start_at, end_at];
+ const params = [param, param, website_id, start_at, end_at];
const { pageviewQuery, sessionQuery, eventQuery, joinSession } = parseFilters(
table,
column,
@@ -26,12 +26,13 @@ function relationalQuery(param, website_id, start_at, end_at, column, table, fil
return rawQuery(
`select * from (
select
- url, ${splitFn}(${splitFn}(url, concat($1, '='), 2), '&', 1) param
+ url,
+ IF( LENGTH(url) - LENGTH(${splitFn}(url, concat($1, '='), -1)) > 1, ${splitFn}(${splitFn}(url, concat($2, '='), -1), '&', 1), null ) param
from
pageview
${joinSession}
where
- ${table}.website_id=$2 and ${table}.created_at between $3 and $4
+ ${table}.website_id=$3 and ${table}.created_at between $4 and $5
${pageviewQuery}
${joinSession && sessionQuery}
${eventQuery}