analytics: add Marlin SDK and migrate dropdown Heap markers

Introduces @docker/marlin-sdk-web-public for first-party pageview and
click analytics, bundled into scripts.js via Hugo's existing js.Build
pipeline. Config is emitted to window.__marlinConfig from head.html and
gated to prod/staging only.

Renames data-heap-id attributes on the markdown-dropdown buttons to
marlin-action so they are picked up by the SDK's auto-click tracking.

TODO: replace the REPLACE-ME endpoint placeholders in hugo.yaml with
the canonical Marlin ingestion URLs from the data-platform team.

TODO: heap.track() calls in youtube-script.html are left in place —
the public SDK exposes no equivalent track() method, so video
play/pause events cannot be migrated yet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson
2026-05-21 16:38:55 +02:00
parent 807a8ec42a
commit a6c2209c7f
6 changed files with 115 additions and 4 deletions
+1
View File
@@ -17,6 +17,7 @@
"@alpinejs/collapse": "3.15.8",
"@alpinejs/focus": "3.15.8",
"@alpinejs/persist": "3.15.8",
"@docker/marlin-sdk-web-public": "0.2.0",
"@floating-ui/dom": "1.7.6",
"@tailwindcss/cli": "4.2.1",
"@tailwindcss/typography": "0.5.19",