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.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Truncate URL lengths.
Mike Cao247afc8c33ec
diff --git a/lib/constants.js b/lib/constants.jsindex 95421b227..476032491 100644--- a/lib/constants.js+++ b/lib/constants.js@@ -86,6 +86,8 @@ export const DESKTOP_SCREEN_WIDTH = 1920;export const LAPTOP_SCREEN_WIDTH = 1024;export const MOBILE_SCREEN_WIDTH = 479;+export const URL_LENGTH = 500;+export const DESKTOP_OS = ['Windows 3.11','Windows 95',diff --git a/lib/queries.js b/lib/queries.jsindex 48f9f2659..5cdba3723 100644--- a/lib/queries.js+++ b/lib/queries.js@@ -1,7 +1,13 @@import moment from 'moment-timezone';import prisma from 'lib/db';import { subMinutes } from 'date-fns';-import { MYSQL, POSTGRESQL, MYSQL_DATE_FORMATS, POSTGRESQL_DATE_FORMATS } from 'lib/constants';+import {+ MYSQL,+ POSTGRESQL,+ MYSQL_DATE_FORMATS,+ POSTGRESQL_DATE_FORMATS,+ URL_LENGTH,+} from 'lib/constants';export function getDatabase() {const type =@@ -190,8 +196,8 @@ export async function savePageView(website_id, session_id, url, referrer) {session_id,},},- url,- referrer,+ url: url.substr(0, URL_LENGTH),+ referrer: referrer.substr(0, URL_LENGTH),},}),);@@ -211,7 +217,7 @@ export async function saveEvent(website_id, session_id, url, event_type, event_vsession_id,},},- url,+ url: url.substr(0, URL_LENGTH),event_type,event_value,},