Turned the analytics tracker off by default in the template.

This commit is contained in:
2026-08-13 02:57:47 +02:00
parent b68eac4375
commit 2206d71997
13 changed files with 178 additions and 71 deletions
@@ -120,4 +120,16 @@ struct AnalyticsTests {
])
}
@Test
func `omits the domains filter when it is empty`() {
// The tracker reads the attribute as an allowlist, so rendering it empty would filter out every host rather than none.
let analytics = Analytics(
scriptURL: "https://analytics.example.com/script",
websiteID: "id-123",
domains: ""
)
#expect(!analytics.attributes.map(\.name).contains("data-domains"))
}
}