Repository navigation
Description
The goal
We can see how visitors use the atlas: which parts they open, and how often they go on to register for a class or share one. We can also see, accurately, how much each client site uses the service. We learn both without recognising individual people.
Why it matters
We make decisions about the atlas without knowing how it is used. Today we know nothing at all: the analytics service was wired up but never switched on in production, so no visitor has ever been counted, and the integrator guide describes a flow that never runs. Separately, the usage figure we keep for each client site is inflated, which makes the service look busier than it is and can raise a false alarm about a site abusing it.
What success looks like
- Someone outside the dev team can open one page and see, for the last month, how many people opened the atlas, how many searched, how many opened a class, how many started registering, and how many finished.
- Those numbers can be broken down by which website the atlas was embedded in, and the breakdown names at least two different sites.
- The numbers are demonstrably live, not merely configured: a named person browses the live atlas, and within a day their visit shows up in the report.
- A sidebar embed nobody opens produces no visitor record, by design, and the report says so where the numbers are read, so a quiet site is not mistaken for a broken one.
- Nothing new is stored in the visitor's browser, and no new way of recognising the same person across visits is added. Anything a host site can observe is written into the integrator guide and the changelog in the same change.
- A written answer exists to "how long is this kept, and who can see it", naming who owns the account, before the first number is collected.
Not included
- The client-site usage figure. It is its own goal now, We know accurately how much each client site uses the atlas SahajCloud#1015.
- Advertising or selling data. Nothing like that is in scope.
- Reporting what visitors typed into the search box. This is the one addition that would put the privacy promise at risk, and we have already promised host sites we never send it.
- Letting a host site switch analytics off from its embed snippet. We removed that switch deliberately; the equivalent is a setting we hold, not one an editor edits.
- Recognising the same visitor across separate visits, which would need something stored in the host site's browser storage.
- Measuring panning, zooming and marker clicks on the map. High volume, little decision value.
- Changing how often an embed reports itself, and retuning the abuse alerting. Both are adjacent and separately ticketed.
Decisions
These two were settled before this goal was written. They are recorded here so the goal is not re-litigated, and so the next reader can see they are closed.
- Do we report what a visitor typed in the search box? → No. The atlas sends the route only and never the typed text, and the integrator guide promises host sites exactly that (recorded in the guide's privacy section; no ticket).
- Can a host site turn analytics off from its embed snippet? → No. The snippet parameter was removed and the element reads no such attribute. What gates analytics is configuration we hold (recorded in feat(widget): split the embed into a smart loader and an element bundle #149).
- Is this one goal or two? → Split it. Visitor insight stays here; the client-site usage figure is its own goal, We know accurately how much each client site uses the atlas SahajCloud#1015. (Ardnived, 2026-10-21)
- Which analytics service, and who owns the account? → A service that can break numbers down by site, as the 2026-07 evaluation on feat(widget): instrument event surfaces + evaluate TelemetryDeck #51 recommended (TelemetryDeck). The account owner is still to be named. (Ardnived, 2026-10-21)
- What counts as one "use"? → A visit: one per person per browsing session, held in memory only and forgotten when the tab closes, so nothing is written to the host site's storage. (Ardnived, 2026-10-21)
Open questions
None.
Notes
Related: #51, #109, #160, sydevs/SahajCloud#891
The inflated client-site figure is diagnosed in sydevs/SahajCloud#891, which already has an open pull request. That dependency belongs on the specific child ticket that covers the figure, not on this whole goal, so the rest of the work is not held up behind it.
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsAwaiting
Activity
sydevs-bot commentedon Oct 8, 2026
🤖 no session running
recent dispatches
Written by the sydevs dispatcher. Sessions never edit this comment.
sydevs-bot commentedon Oct 8, 2026
Technical notes for #260. Edited in place. Planning reads this; the body stays plain.
The finding that reframes the goal: analytics has never run in production
VITE_FATHOM_IDis unset on Pages Production, so there has never been pageview data. Evidence, from read-only GETs of the live deploy:sahajatlas.com/plus everyassets/*.jsit andauto.jsreference — 20 chunks, 3.6 MB. Zerofathom, case-insensitive.cloud.sydevelopers.com,api.mapbox.com,ipwho.is,o…ingest.de.sentry.io.cooperative(feat(embed): gestures=cooperative lets the host page scroll past a contained map #251) is present inFullInterface-BbpJZ-gK.js.honorDNTis absent from that same chunk, though it is the literal in our ownFathom.load(src/views/FullInterface.tsx:77). The branch was dead-code-eliminated, which only happens when!!import.meta.env.VITE_FATHOM_IDfolds tofalseat build time.VITE_SENTRY_DSNis Cloudflare-set (docs/environment.md:23) and its ingest host is in the bundle.VITE_FATHOM_IDis listed as.env.localonly (docs/environment.md:31).So success line 1 starts from zero.
docs/embedding.md:1088describes a flow that never fires, and every host's CSP carriescdn.usefathom.comfor nothing. This is the #232 failure class (Sentry DSN unset, zero events for seven weeks), and no gate catches it —tests/smoke/boot-origins.smoke.test.tsis where a presence assertion belongs.What exists today
useAnalytics,src/views/FullInterface.tsx:60-88.load(auto: false, honorDNT: true)once per document; onetrackPageviewper distinct in-widget pathname, deduped by module-scopelastTracked. Pathname only, neverlocation.search(:84-86).App.tsx:390-404, so embed and standalone behave identically. InFullInterface, notAppShell, so a collapsed card reports nothing (src/components/AGENTS.md:325-340).allowedDomains(src/App.tsx:378-389), not a dedicated field. An empty list — which SahajCloud reads as "all origins" — yields'', so analytics is off for that client entirely.grep -rn "trackEvent\|trackGoal" src/→ 0 hits.usageTrackingBeforeOperationHook(SahajCloud/src/plugins/usage/hooks.ts:418-454), one atomic UPDATE per top-level client read, on every collection butclientsand every global since SahajCloud#710. Feeds the admin display,HIGH_USAGE_THRESHOLD = 1000alerts andabuseScore. Nothing throttles on it — rate limiting is a Cloudflare edge rule.Why the count is too high — four causes, ranked
sy-atlas-configandsy-atlas-translationsglobals, plus/forms/:idon every page view) — per API key, while the goal asks per client site. One key serves up to 50 mounts.webPath/webUrlbills twice, and the atlas selects both (src/config/api/fetch.ts:119,138-139). Open PR SahajCloud#896 fixes it.VerifyEmbedsrenders host pages (booting the widget), and each live-preview edit triggers a populate read.shouldRetryQuery,src/config/query-client.ts).Settled, so not an open question:
POST /api/clients/reportis NOT metered.clientsis in the plugin's exclusion set (SahajCloud/src/plugins/usage/usagePlugin.ts:68), perSahajCloud/docs/rules/api-clients.md. So #160's cadence inflates request traffic and the 50-mount cap, notusage_daily_requests. Also ruled out:refetchOnWindowFocusis off (:!1in the shipped bundle); a second widget or loader copy is refused; the smoke lanes read static files only.Packages and platforms weighed
fathom-client@^3.7.2)trackEvent(name, {_value})) — no properties, so it cannot segment "how many registered" per site. Ad-blockable, so never a billing source.script-src/connect-src, and a host that does not silently loses all analytics.functions/dir or wrangler config exists — this is "build a product-analytics platform". No.user-submissionsalready carries an indexed, server-composedclientrelationship (fields.ts:619), so registration counts per client are an exact SQL query with zero new instrumentation and zero privacy delta.distinct_idby default, breaking the no-host-storage posture (#95).The four children
⚠ Corrected mid-run. These were parentless when this run began; all four were linked as sub-issues of #260 while it was in progress, so this section no longer describes them as adoptable candidates. They are the children.
blocked, Hold Until 2026-11-15No
replanwas requested, deliberately. Four open questions are unticked, andimplement-roadmapcannot plan past an unsettled decision, so a replan session now would do nothing. Questions 1 and 2 also decide whether the goal splits and which backend the children target — replanning before those answers would be rework. The next step is the reviewer's answers, then@sydevs-bot implement.A fifth child is missing: nothing covers "switch analytics on and prove it stays on" (split item 1 below). Planning should file it.
Where the lenses disagreed
Scope said "no new origin for #260; keep Fathom's name-only events, defer the vendor to #51". Gaps said "adopt TelemetryDeck". Scope holds on the framing — a vendor migration is #51's goal — but it cannot meet success line 2, since name-only events cannot be split per site. So the vendor is a budget-and-ownership choice, raised as open question 2.
Second: gaps wanted a session-scoped visit id; scope called sessions out of scope as needing host-origin storage. Resolution: an in-memory id held for the tab's life writes nothing to the host's origin, so #95 holds. Only a persisted id would reverse it, and that stays in
## Not included.Risks
docs/embedding.md's two CSP tables, a privacy bullet, and aCHANGELOG.mdentry in the same PR, plus ~31 client records to coordinate. Hosts that do not update fail silently.ipwho.isgets the visitor's IP once per session, Mapbox writes a persistent anonymous id, Sentry carriesnavigator.userAgent. The body now says no new collection — do not revert that wording.Sketch of a split (reviewability seams)
boot-origins.smoke.test.ts. Small, independent, prerequisite for every other visitor line. No child covers this yet.Blocked by:SahajCloud#891 belongs on that child, not on the goal.Could not settle
🤖 Written by the sydevs autonomous loop — see what this is
sydevs-bot commentedon Oct 8, 2026
The atlas has never had analytics in production.
VITE_FATHOM_IDis unset on Pages Production, so the tracker is dead-code-eliminated from the shipped bundle — no trace of it in all 20 chunks of the live deploy, while the Sentry host is there as a control. Line 1 starts from zero.The inflated per-site count is diagnosed in sydevs/SahajCloud#891, which has an open PR. Deeper cause: the figure counts API requests per key, not visits per site.
POST /api/clients/reportis not metered, so #160 is traffic hygiene, not the count fix.I rewrote the body — sharper success lines, six items moved to
## Not included, two settled positions recorded. Detail is in the notes comment above.Four decisions need you, in
## Open questions: one goal or two, which analytics service and who owns the account, what the per-site figure is for, and what counts as one "use". Each has options and a recommendation. Reply@sydevs-bot revise 1Aor in your own words.Once none are open,
@sydevs-bot implementplans the implementation tickets.🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Ardnived commentedon Oct 21, 2026
Answered in the terminal by @Ardnived:
The client-site usage figure is now its own goal, sydevs/SahajCloud#1015, with this goal's old question 3.