fix(analytics): umami custom host should be a string (closes #852)

This commit is contained in:
Jacky Zhao 2024-02-12 09:00:58 -08:00
parent 5dc4f21a4b
commit a7325eadc1

View file

@ -120,7 +120,7 @@ function addGlobalPageResources(
} else if (cfg.analytics?.provider === "umami") { } else if (cfg.analytics?.provider === "umami") {
componentResources.afterDOMLoaded.push(` componentResources.afterDOMLoaded.push(`
const umamiScript = document.createElement("script") const umamiScript = document.createElement("script")
umamiScript.src = ${cfg.analytics.host} ?? "https://analytics.umami.is/script.js" umamiScript.src = "${cfg.analytics.host}" ?? "https://analytics.umami.is/script.js"
umamiScript.setAttribute("data-website-id", "${cfg.analytics.websiteId}") umamiScript.setAttribute("data-website-id", "${cfg.analytics.websiteId}")
umamiScript.async = true umamiScript.async = true