From 59bdc99d9f5dd34b23c522ca431e6f2f0acb5a8b Mon Sep 17 00:00:00 2001 From: tobinio Date: Mon, 14 Jul 2025 18:21:48 +0200 Subject: [PATCH] add event on statsFilterChange --- app/composables/useStatData.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/composables/useStatData.ts b/app/composables/useStatData.ts index 405e095..a2466b5 100644 --- a/app/composables/useStatData.ts +++ b/app/composables/useStatData.ts @@ -5,6 +5,16 @@ export function useStatData( // biome-ignore lint: can be any params: Record, ) { + watch( + () => Object.values(params).map((ref) => ref.value), + () => { + const unwrapped = Object.fromEntries( + Object.entries(params).map(([key, ref]) => [key, ref.value]), + ); + umTrackEvent("statsFilterChanged", unwrapped); + }, + ); + const url = computed(() => { if (isGlobalStats.value) { return "/api/stats/time/global"; -- 2.54.0