chore: remove google analytics
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m24s

This commit is contained in:
juancwu 2026-03-03 15:47:48 +00:00
commit 57b91b81d3
2 changed files with 0 additions and 17 deletions

View file

@ -13,10 +13,8 @@ func SecurityHeaders() func(http.Handler) http.Handler {
h.Set("Content-Security-Policy",
"default-src 'self'; "+
"script-src 'self' 'unsafe-inline' https://www.googletagmanager.com; "+
"style-src 'self' 'unsafe-inline'; "+
"img-src 'self' data:; "+
"connect-src 'self' https://www.google-analytics.com; "+
"font-src 'self'; "+
"frame-ancestors 'none'; "+
"base-uri 'self'; "+

View file

@ -63,10 +63,6 @@ templ Base(props ...SEOProps) {
@htmxCSRFScript()
// Form submit spinner for non-HTMX forms
@formSubmitScript()
// Google Analytics
if cfg := ctxkeys.Config(ctx); cfg != nil && cfg.GoogleMeasuringID != "" {
@googleAnalyticsScript(cfg.GoogleMeasuringID)
}
</head>
<body class="min-h-screen">
{ children... }
@ -128,14 +124,3 @@ templ htmxCSRFScript() {
templ formSubmitScript() {
<script src="/assets/js/form-submit.js"></script>
}
templ googleAnalyticsScript(id string) {
<script async src={ "https://www.googletagmanager.com/gtag/js?id=" + id }></script>
<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
window.gtag = gtag;
gtag('js', new Date());
gtag('config', {{ id }});
</script>
}