summaryrefslogtreecommitdiff
path: root/Biz/PodcastItLater
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-17 22:30:10 -0500
committerBen Sima <ben@bensima.com>2025-12-17 22:30:10 -0500
commitb70fc85ab91eda55a8ac34c54a2c869e3225b863 (patch)
treec85b113876b910b1a0360d3dcaa91d4f83e2186e /Biz/PodcastItLater
parente2ea8308d74582d5651ed933dea9428ce8982d25 (diff)
feat: add goatcounter analytics to PodcastItLater
- Add goatcounter NixOS service to Biz.nix (SQLite backend, port 8081) - Add tracking script to UI.py PageLayout component - Configure for proxy mode (behind Caddy)
Diffstat (limited to 'Biz/PodcastItLater')
-rw-r--r--Biz/PodcastItLater/UI.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Biz/PodcastItLater/UI.py b/Biz/PodcastItLater/UI.py
index d4b60a9..87b087e 100644
--- a/Biz/PodcastItLater/UI.py
+++ b/Biz/PodcastItLater/UI.py
@@ -128,6 +128,15 @@ def create_bootstrap_js() -> html.script:
)
+def create_goatcounter_script() -> html.script:
+ """Load GoatCounter analytics script."""
+ return html.script( # type: ignore[call-arg]
+ data_goatcounter="https://podcastitlater.goatcounter.com/count",
+ async_=True,
+ src="//gc.zgo.at/count.js",
+ )
+
+
class PageLayoutAttrs(Attrs):
"""Attributes for PageLayout component."""
@@ -310,6 +319,7 @@ class PageLayout(Component[AnyChildren, PageLayoutAttrs]):
html.title(page_title),
*meta_tags,
create_htmx_script(),
+ create_goatcounter_script(),
),
html.body(
create_bootstrap_styles(),