Skip to content

feat(analytics): self-hosted Umami tracker on keepsimple.io - #176

Merged
manager merged 1 commit into
devfrom
umami-setup
Aug 12, 2026
Merged

feat(analytics): self-hosted Umami tracker on keepsimple.io#176
manager merged 1 commit into
devfrom
umami-setup

Conversation

@manager

@manager manager commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Adds our self-hosted, cookieless Umami tracker to keepsimple.io alongside Mixpanel. Nothing is removed.

  • Script tag in _document.tsx, domain-scoped with data-domains so staging and preview traffic is not counted.
  • The site is already registered in our Umami instance.
  • Also commits the font passport block into CLAUDE.md, which was live in the working copy but never committed.

Why: the current Mixpanel plan blocks API access (402 on every query endpoint), so no automation can read our own product numbers. Umami gives machine-readable data for free, and its self-hosted v3 covers funnels, retention, journeys and goals.

Merging this branch into dev builds the staging image; production only follows on a later merge to main.

🤖 Generated with Claude Code

Cookieless Umami (analytics.administration.ae), domain-scoped to
keepsimple.io + www so staging and preview traffic is not counted.
Runs alongside Mixpanel; nothing removed. Also lands the font passport
block in CLAUDE.md, which was live locally but never committed.
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Claude finished @manager's task in 1m 15s —— View job


Review: PR #176 — self-hosted Umami tracker

  • Gather context (diff, files, AGENTS.md conventions)
  • Review _document.tsx changes (SSR safety, script placement, security)
  • Review CLAUDE.md diff (font passport block)
  • Post review feedback

⚠️ Security concern (blocking, please confirm before merge)

I left an inline comment on src/pages/_document.tsx:18: the script tag loads from https://analytics.administration.ae/script.js, which does not match keepsimple.io or any KeepSimple-owned domain I can find in this repo. The PR describes this as "self-hosted," but the script origin is an unrelated third-party domain. This unconditionally injects remote JS with full page/DOM access on every render (dev, staging, prod) — unlike GA/Mixpanel, which are lazy-loaded and gated behind NEXT_PUBLIC_INDEXING (src/pages/_app.tsx:48,147,236). data-domains only scopes what Umami records, it doesn't stop the script from executing.

Please double-check that analytics.administration.ae is the intended, trusted, KeepSimple-controlled endpoint before this merges. If confirmed correct, still worth considering:

  • Move src / data-website-id into env vars (NEXT_PUBLIC_UMAMI_*) instead of hardcoding, consistent with how the other trackers are configured per-environment.
  • SRI (integrity attribute) if the host serves a versioned/immutable script, since it's unauthenticated and loads on every page.

Other notes

  • SSR/hydration: no issues — this is a plain <script> tag in Head, server-rendered, no window/localStorage access at module scope.
  • Project conventions: no App Router, Tailwind, or barrel-file violations. Nothing else in the diff touches component/data patterns.
  • CLAUDE.md font-passport block: pure documentation addition, no functional impact. Minor nit: it's inserted above the # CLAUDE.md title rather than under a section — cosmetic only, not blocking.

No other correctness, accessibility, or styling issues found in this small diff.
· Branch: umami-setup

Comment thread src/pages/_document.tsx
{/* Umami, self-hosted, cookieless. data-domains keeps preview/staging traffic out. */}
<script
defer
src="https://analytics.administration.ae/script.js"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security: third-party script domain doesn't match the "self-hosted" claim.

The PR description says this is a "self-hosted Umami tracker," but the script is loaded from analytics.administration.ae — a domain unrelated to keepsimple.io or any KeepSimple-owned infrastructure I can find in this repo. That's a meaningful discrepancy:

  • This unconditionally injects third-party JS with full DOM/page access into <Head> on every render (dev, staging, prod, preview) — unlike GA/Mixpanel, which are lazy-loaded and gated behind NEXT_PUBLIC_INDEXING (see src/pages/_app.tsx:48,147,236). data-domains only filters what Umami records; it does not stop the script from loading and executing on every deploy.
  • A compromised or unverified third-party origin serving script.js here can read cookies/localStorage, exfiltrate data, or modify the DOM — full script-injection blast radius.
  • If this is genuinely self-hosted, the script origin should be KeepSimple-owned infra (e.g. analytics.keepsimple.io), not an unrelated third-party domain.

Please confirm analytics.administration.ae is an intentionally provisioned, trusted endpoint before merging. If it is, consider:

  • Sourcing the URL/website-id from an env var (NEXT_PUBLIC_UMAMI_*) rather than hardcoding, so staging/prod and endpoint rotation don't require code changes.
  • Adding integrity (SRI) if the endpoint supports versioned/immutable script hashes, since this loads on every page unauthenticated.

Fix this →

@manager
manager merged commit 0d9a565 into dev Aug 12, 2026
2 checks passed
manager added a commit that referenced this pull request Aug 12, 2026
The Umami script tag shipped in #176 is blocked by our own CSP: neither
script-src nor connect-src allows analytics.administration.ae, so browsers
refuse to load the tracker and to send events. Adds the host to both.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant