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 boolean event data.

Brian Cao65ebb26a7007
diff --git a/components/pages/console/TestConsole.js b/components/pages/console/TestConsole.js
index 745bf94c5..6c14c2c19 100644
--- a/components/pages/console/TestConsole.js
+++ b/components/pages/console/TestConsole.js
@@ -30,6 +30,8 @@ export function TestConsole() {
window.umami.track('track-event-with-data', {
data: {
test: 'test-data',
+ boolean: true,
+ booleanError: 'true',
time: new Date(),
number: 1,
time2: new Date().toISOString(),
diff --git a/lib/eventData.ts b/lib/eventData.ts
index 4588d0817..aee1f9b43 100644
--- a/lib/eventData.ts
+++ b/lib/eventData.ts
@@ -49,6 +49,7 @@ function createKey(key, value, acc: { keyValues: any[]; parentKey: string }) {
break;
case 'boolean':
eventDataType = EVENT_DATA_TYPE.boolean;
+ value = value ? 'true' : 'false';
break;
case 'date':
eventDataType = EVENT_DATA_TYPE.date;
diff --git a/queries/analytics/event/getEvents.ts b/queries/analytics/event/getEvents.ts
index b3853f2de..8197019dc 100644
--- a/queries/analytics/event/getEvents.ts
+++ b/queries/analytics/event/getEvents.ts
@@ -1,7 +1,6 @@
-import prisma from 'lib/prisma';
import clickhouse from 'lib/clickhouse';
-import { runQuery, CLICKHOUSE, PRISMA } from 'lib/db';
-import { EVENT_TYPE } from 'lib/constants';
+import { CLICKHOUSE, PRISMA, runQuery } from 'lib/db';
+import prisma from 'lib/prisma';
export function getEvents(...args: [websiteId: string, startAt: Date, eventType: number]) {
return runQuery({