Merge pull request #1356 from biqette/master

Fix UTM request
This commit is contained in:
Mike Cao 2022-08-01 20:42:56 -05:00 committed by GitHub
commit b04e03b4d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}