Repository navigation
Improvement: count where visits come from and how the sign-in prompt is answered, and tag Modwerk's own links - #1725
Merged
Merged
Conversation
…is answered Identifier-free daily totals in site_count_daily (migration 0097), through /usage/count: visit_source (one fixed category from utm_source or the referring domain, mapped in the browser; never the address; no count for a reload, back/forward or a page reached from the site) and sign_in_prompt (shown, sign in, create account, skipped, closed; before a build or before a member action). The admin statistics show both; the 7-day statistics route stays within its read budget by reading them with the page totals. The privacy page names both counts in English and German. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d drop the tag once read News, activity, welcome and beta mail tag every link to the site as utm_source=mail-<kind> when sent (server/mail-links.ts); account mail, API links, images and links elsewhere stay untouched. The site removes utm_ tags from the address after counting the visit, so shared or bookmarked links do not credit the mail again. Mail tests now expect the tagged links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…=discord-bot Both Discord senders (the maintenance bot's act step and /modwerk-discord's replyBody) tag modwerk.app links through the shared helper, renamed to server/site-link-tags.ts. A reply the tags would push past 2000 characters goes out as written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…with utm_source The push service worker opens notifications tagged push, the forum Atom feed tags its entry links forum-feed (ids stay untagged), and the thread Share button hands out forum-share links. Push and feed tests now expect the tagged links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the 18 Nov 2026 demand review (#1724 has the first fixes). Visitors fell 30% and sign-ups 65% since early October. The site can't tell where visitors come from, or where sign-ups stop at the sign-in prompt. This adds both, as identifier-free daily totals.
What changed
visit_source, once per page load: one fixed category for where the visit came from.utm_source, or else the referring domain, invisit-source.ts.sign_in_prompt: shown, sign in, create account, skipped or closed. It is split between the prompt before a firmware build (gate-…) and the one before a like, follow or reply (other-…).site_count_daily(migration 0097) through/usage/count. The server refuses any category outside the lists rather than storing it, and keeps 90 days. No visitor digest, no device storage. DNT, GPC and the objection checkbox stop both counts./admin/statisticsreads the site counts in the same statement as the page totals (UNION ALL), so it stays within its 8-read budget.utm_source=mail-<kind>when sent, through one helper inserver/site-link-tags.ts.utm_…from the address after counting, so shared or bookmarked links don't credit the mail again.utm_source=discord-bot, in both senders: the maintenance bot's act step and/modwerk-discord'sreplyBody.discord, or as direct from the desktop app.<link>and[label](link)forms are handled.server/site-link-tags.ts, which plain Node 24 loads as TypeScript.?utm_source=push#<route>; the server still sends routes only.forum-feed. Entry ids stay untagged, so readers keep recognising them.forum-sharelinks, through a newshareLinkhelper inforum-links.ts.Testing
npm run pr:ready: lint, typecheck, generators, build, the module checks and the site test suite pass, and it claimed migration 0097 on the board. Locallysdk:checkfails only because the m68k toolchain (m68k-elf-readelf) is not on this shell's PATH. The branch changes nothing undersdk/; CI decides.src/community/site-counts.test.ts: 33 classifier cases, including look-alike hosts such asreddit.com.evil.test→other. Browser sends carry no address, credentials or storage; an objection stops them; jsdom tests check the dialog's answers.src/community/site-link-tags.test.ts: Discord markdown and the 2000-character limit, HTML entities, text punctuation, hash routes with their own query, foreign and API links, and every welcome-mail link counting asmail-welcome.src/community/site-counts.server.test.ts: fixed lists only, no visitor digest, 90-day cleanup, administrators only.service.test.tsnow loads migration 0097 in its fixture.What the guides lacked
docs/STATISTICS.mdhad no word on traffic sources. It now has a "Visit sources and the sign-in prompt" section, which includes how to tag a campaign link withutm_sourceso it gets credited, and lists what Modwerk tags itself: mail, TARS's Discord replies, push notifications, the forum feed and the Share button.🤖 Generated with Claude Code