Repository navigation
Record where downloads come from, and GitHub's download totals - #79
Merged
Merged
Conversation
- The first page view of a visit records the referring site's host (never its full address) and the link's utm_source, utm_medium and utm_campaign tags. - The site's download links carry that source and the page they were clicked on; a download link on another site is credited to that site's host. - Web sightings now keep the real referring site instead of this website. - The events Worker saves GitHub's per-file release totals once a day, so downloads made straight from GitHub are counted. Windows and Linux totals include updates that fell back to GitHub. - The analytics report shows 30-day downloads by source, campaign, place, network and GitHub's totals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying scientfactory-website with
|
| Latest commit: |
4506407
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1e4d2c05.scientfactory-website.pages.dev |
| Branch Preview URL: | https://feature-download-sources-202.scientfactory-website.pages.dev |
…each repo's totals - Campaign tags must be short labels with no "/" or "@", checked in the browser before anything is stored or sent, and again on the server. - Page and landing paths must be paths on this site: "//host/..." and paths with an email are dropped. - Web sightings record only the visit's source, never this website's own page from the request's Referer. - A GitHub failure for one repository no longer discards the other's totals; the next run retries only the repository that failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Answers "where do downloads come from?":
utm_source,utm_mediumandutm_campaigntags. The browser keeps them for the tab only. The site's download links carry them, plus the page the download was clicked on. A download link on another site is credited to that site's host.analytics_web_sightings). Its referrer column used to hold this website's own host; it now holds the real referring site.github_release_downloads, migration 0009). Mac.dmgtotals are installs only. Windows.exeand Linux.AppImagetotals also include updates that fell back to GitHub from the update mirror. Updates the app makes are counted separately by the app (app.update.outcome).bun run analytics:reportshows 30-day downloads by source, campaign, place, network and GitHub's totals.Values that look like an address, a path or an email are dropped before storage.
Documentation and source-version impact
Documentation impact: Updated — README.md (Website analytics: visit source and GitHub totals; repository family line for scient-agent) and src/pages/privacy.astro (installers are served by ScientFactory or GitHub). The owner chose this wording: the existing "usage, device and network information to understand how people find and start using Scient" already covers the visit source, so nothing else was added.
Validation
bun run check(format, typecheck, 199 tests, site build, worker builds)referrer_hostand the tags, later views sent nothing extra, and download links carried the source while other links were untouched. Not yet observed in a real browser or on the Cloudflare preview.Live check:
https://scientfactory.com/download?utm_source=check301s to/about/?utm_source=check#downloads, so links to/downloadkeep their tags and referrer.Quality Review
Light Codex review of b53b1c7: four findings, all confirmed and fixed in the next commit.
sessionStorage, the download URL, and (forhost/path) D1. Fixed: tags must be short labels with no/or@, checked in the browser before storage and again on the server. Re-ran the built script:utm_campaign=person%40example.comandutm_medium=example.com/private/pathare dropped.pageandlanding_pathaccepted//example.com/...and paths with an email. Fixed incleanPath, which now also covers page views.Integration Readiness Review
Head 4506407. Author review after the Codex fixes: all four findings fixed and tested; the privacy commit changes one sentence and the date. No open findings. Evidence gap: the browser script was checked against stand-ins in Node, not in a real browser; the first real check is a tagged visit on production after deploy. Production impact: download redirect targets unchanged; new event properties only; migration 0009 is additive.
Deployment impact
bun run db:migrate) before deploying the events Worker (bun run events:deploy); Pages code does not need the new table.GITHUB_TOKENWorker secret raises GitHub's rate limit; without it the job uses public, unauthenticated requests at most once an hour until a day is saved.🤖 Generated with Claude Code