feat(analytics): Support for Umami (#449)

This commit is contained in:
Adam Brangenberg authored and GitHub committed 2023-09-03 21:28:57 -07:00
1 parent 7e42be8e46
commit e8a04efaf1
2 files changed
+13

No files matched your search

@@ -96,6 +96,15 @@ function addGlobalPageResources(
});`)
} else if (cfg.analytics?.provider === "plausible") {
componentResources.afterDOMLoaded.push(plausibleScript)
} else if (cfg.analytics?.provider === "umami") {
componentResources.afterDOMLoaded.push(`
const umamiScript = document.createElement("script")
umamiScript.src = "https://analytics.umami.is/script.js"
umamiScript["data-website-id"] = "${cfg.analytics.websiteId}"
umamiScript.async = true
document.head.appendChild(umamiScript)
`)
}
if (cfg.enableSPA) {