From 4f51077e1450d0ab0d792d3e85d58852a20956af Mon Sep 17 00:00:00 2001
From: Mark Smith
Date: Sun, 18 Oct 2026 20:26:57 +0100
Subject: [PATCH 1/3] feat(tutorial): GA4 events for exit and
completion-to-play
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fire two GA4 events so the newbie funnel can tell early exits from finishers:
- exit_tutorial — when a player clicks Exit Tutorial
- tutorial_complete_play — when they click Play MUME Now at the end (screen + modal)
Both carry the current chapter. GA is already configured in the theme, so this
only sends named events; nothing else changes.
Co-Authored-By: Claude Opus 4.8
---
.../theme/components/TutorialPlayer.vue | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/docs/.vitepress/theme/components/TutorialPlayer.vue b/docs/.vitepress/theme/components/TutorialPlayer.vue
index a67f901..fb56182 100644
--- a/docs/.vitepress/theme/components/TutorialPlayer.vue
+++ b/docs/.vitepress/theme/components/TutorialPlayer.vue
@@ -105,6 +105,15 @@ function closeModal() {
isModalOpen.value = false
}
+// Fire a GA4 event when a player leaves the tutorial early (exit_tutorial) or
+// finishes and heads to the game (tutorial_complete_play). GA is already set up in
+// the theme; this only sends a named signal with the chapter they were on.
+function trackTutorial(name: string) {
+ try {
+ ;(window as any).gtag?.('event', name, { event_category: 'tutorial', chapter: chapterNum.value })
+ } catch { /* analytics is best-effort, never block navigation */ }
+}
+
function openImageModal(src: string, alt = '') {
activeModalImage.value = { src, alt }
}
@@ -699,7 +708,7 @@ onUnmounted(() => {
{{ isExpanded ? 'Shrink' : 'Full' }}
-
+
Exit
@@ -777,7 +786,7 @@ onUnmounted(() => {
You have mastered movement, equipment, stats, combat, scouting, skills, and resting in Middle-earth.
@@ -879,7 +888,7 @@ onUnmounted(() => {