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:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user