Skip to content

Commit 89e261f

Browse files
nunocoracaoclaude
andcommitted
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>
1 parent d35a493 commit 89e261f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

layouts/partials/analytics/umami.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute("content");
2424
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute("content");
2525
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute("content");
26-
umami.track(type + ":" + title, { url: url });
26+
umami.track(type + ":view", { title: title, url: url });
2727
});
2828
</script>
2929
{{ end }}

0 commit comments

Comments
 (0)