From f0072f992f8b2d95350c8618e85d0a03137fb055 Mon Sep 17 00:00:00 2001 From: santosral Date: Wed, 4 Feb 2026 15:16:50 +0800 Subject: [PATCH 1/2] feat: add GA profile clicked tracker --- src/lib/helpers/analytics.ts | 11 +++++++++++ src/routes/(protected)/(core)/+layout.svelte | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/src/lib/helpers/analytics.ts b/src/lib/helpers/analytics.ts index 5ba58c1e..c9431b08 100644 --- a/src/lib/helpers/analytics.ts +++ b/src/lib/helpers/analytics.ts @@ -180,3 +180,14 @@ export function trackSourcesClick(learningUnitId: string) { learning_unit_id: learningUnitId, }); } + +/** + * Tracks when the profile is clicked. + */ +export function trackProfileClick() { + if (!browser) { + return; + } + + window.gtag('event', 'profile_click'); +} diff --git a/src/routes/(protected)/(core)/+layout.svelte b/src/routes/(protected)/(core)/+layout.svelte index 1aae461a..e5879ac5 100644 --- a/src/routes/(protected)/(core)/+layout.svelte +++ b/src/routes/(protected)/(core)/+layout.svelte @@ -1,7 +1,9 @@
@@ -34,6 +40,7 @@ href="/profile" aria-label="Profile" class="h-10 w-10 cursor-pointer overflow-hidden rounded-full" + onclick={handleProfileClick} > profile From d89f2ec5c9beb0fbbc9b419cfe91ad8af48eb8e8 Mon Sep 17 00:00:00 2001 From: santosral Date: Wed, 4 Feb 2026 15:18:00 +0800 Subject: [PATCH 2/2] fix: homepage redirection for quiz retry modal --- src/routes/(protected)/unit/[id]/quiz/+page.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/(protected)/unit/[id]/quiz/+page.svelte b/src/routes/(protected)/unit/[id]/quiz/+page.svelte index 21688331..2fbf3bc2 100644 --- a/src/routes/(protected)/unit/[id]/quiz/+page.svelte +++ b/src/routes/(protected)/unit/[id]/quiz/+page.svelte @@ -8,6 +8,7 @@ import { Button, LinkButton } from '$lib/components/Button/index.js'; import { Modal } from '$lib/components/Modal/index.js'; import { + HOME_PATH, IsWithinViewport, noop, trackQuizAttempt, @@ -303,7 +304,7 @@ Back to home