Skip to content

Replace PostHog with self-hosted Umami analytics - #131

Merged
Melvynx merged 3 commits into
mainfrom
agent/add-umami-analytics
Jul 10, 2026
Merged

Replace PostHog with self-hosted Umami analytics#131
Melvynx merged 3 commits into
mainfrom
agent/add-umami-analytics

Conversation

@Melvynx

@Melvynx Melvynx commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What changed

  • load the self-hosted Umami tracker once from https://analytics.melvynx.dev/script.js
  • restrict automatic page-view tracking to the production saveit.now hostname and respect Do Not Track
  • remove the PostHog SDK, provider, error boundary, event calls, build variables, and Dokploy PostHog environment keys
  • add a typed, dependency-free Umami event helper that safely no-ops during SSR or when the tracker is unavailable
  • track only SaveIt-relevant aggregate actions without bookmark IDs, URLs, email addresses, or other user content
  • update analytics documentation and the privacy disclosure

SaveIt events

  • bookmark opened, copied, shared, deleted, and reprocessed (with UI surface only)
  • bookmark import count and CSV export
  • social sign-in started (provider only)
  • upgrade checkout started (monthly/yearly only)
  • iOS download clicked (UI surface only)

Validation

  • pnpm --filter web typecheck
  • pnpm lint (0 errors; existing repository warnings only)
  • pnpm --filter web test:ci (183 tests passed)
  • production pnpm vercel-build
  • generated output contains the expected Umami endpoint and zero PostHog references
  • https://analytics.melvynx.dev and /api/heartbeat return HTTP 200 with valid Let's Encrypt TLS
  • Umami collector accepted a synthetic verification event and created a session and visit

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
saveit-now-web Ready Ready Preview, Comment Jul 10, 2026 4:13pm

@Melvynx Melvynx changed the title Add self-hosted Umami traffic analytics Replace PostHog with self-hosted Umami analytics Jul 10, 2026
@Melvynx
Melvynx marked this pull request as ready for review July 10, 2026 16:12
@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Melvynx
Melvynx merged commit 5188cd8 into main Jul 10, 2026
6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50471ae69b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

defer
src={UMAMI_SCRIPT_URL}
data-website-id={UMAMI_WEBSITE_ID}
data-domains="saveit.now"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Strip sensitive query strings from Umami pageviews

With the global Umami script enabled here, automatic pageviews will include the page URL's search string unless it is explicitly excluded; this app has real secrets/PII in query params, e.g. /auth/mobile-login?token=..., /unsubscribe/$userId?token=..., and /signin?email=.... When those links are opened on saveit.now, the tokens/emails get sent to analytics, so add data-exclude-search="true" or a data-before-send scrubber before enabling the tracker globally.

Useful? React with 👍 / 👎.

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