Fix Umami event name for long page titles

Use a fixed event name (type:view) and pass the title as metadata
instead of embedding it in the event name, which caused issues with
long page titles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nuno Coração
2026-04-13 22:34:48 +01:00
parent d35a493ba0
commit 89e261f8e4
+1 -1
View File
@@ -23,7 +23,7 @@
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute("content");
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute("content");
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute("content");
umami.track(type + ":" + title, { url: url });
umami.track(type + ":view", { title: title, url: url });
});
</script>
{{ end }}