diff --git a/server/index.ts b/server/index.ts
index f122956..f01bb88 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -167,8 +167,9 @@ if (isProduction) {
// Insert OG tags before
html = html.replace('', `${ogTags}`);
- // Update title
- html = html.replace(/
.*?<\/title>/, `${title} - Activiteiten Inventaris`);
+ // Update title - include participant name for Matomo tracking
+ const pageTitle = `${title} - ${participant.name}`;
+ html = html.replace(/.*?<\/title>/, `${pageTitle}`);
res.send(html);
});
diff --git a/src/pages/PublicQuestionnaire.tsx b/src/pages/PublicQuestionnaire.tsx
index f234168..d15776e 100644
--- a/src/pages/PublicQuestionnaire.tsx
+++ b/src/pages/PublicQuestionnaire.tsx
@@ -65,6 +65,16 @@ export function PublicQuestionnaire({ accessToken }: { accessToken?: string } =
fetchQuestionnaire()
}, [slug, effectiveToken])
+ // Update document title for Matomo tracking
+ useEffect(() => {
+ if (questionnaire) {
+ const title = visitorName
+ ? `${questionnaire.title} - ${visitorName}`
+ : questionnaire.title
+ document.title = title
+ }
+ }, [questionnaire, visitorName])
+
async function fetchQuestionnaire() {
try {
// Use token-based access if available