feat(analytics): Cabin analytics support (#1221)
* add cabin analytics * fix formatting
This commit is contained in:
1 parent
1d94e9c303
commit
3faf2ff6f5
3 files changed
+13
No files matched your search
@@ -144,6 +144,14 @@ function addGlobalPageResources(ctx: BuildCtx, componentResources: ComponentReso
|
||||
tinylyticsScript.defer = true
|
||||
document.head.appendChild(tinylyticsScript)
|
||||
`)
|
||||
} else if (cfg.analytics?.provider === "cabin") {
|
||||
componentResources.afterDOMLoaded.push(`
|
||||
const cabinScript = document.createElement("script")
|
||||
cabinScript.src = "${cfg.analytics.host ?? "https://scripts.cabin.dev"}/cabin.js"
|
||||
cabinScript.defer = true
|
||||
cabinScript.async = true
|
||||
document.head.appendChild(cabinScript)
|
||||
`)
|
||||
}
|
||||
|
||||
if (cfg.enableSPA) {
|
||||
|
||||
Reference in new issue
Block a user