feat: add lite audience analytics to star-tracker#61
Merged
Conversation
Logs each chart-svg and HTML page request into a daily-aggregated views_daily table (referer host, country from cf.country, UA class, 200/304). Rendered as an "Audience" panel on the owner's tenant page: 30-day sparkline, top referers, top countries, client mix. No IPs or raw user-agents stored. Owner self-views and our own domain (in any env) are excluded. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
wavekat-eason
pushed a commit
that referenced
this pull request
May 17, 2026
🤖 I have created a release *beep* *boop* --- ## [0.0.22](wavekat-com-v0.0.21...wavekat-com-v0.0.22) (2026-05-17) ### Features * add favicon to star-tracker ([#60](#60)) ([4075b41](4075b41)) * add gtag analytics to star-tracker ([#58](#58)) ([5441af3](5441af3)) * add lite audience analytics to star-tracker ([#61](#61)) ([2e4b975](2e4b975)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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
/:slug,/:slug/:repo,/:slug/chart.svg, and/:slug/:repo/chart.svgrequest into a newviews_dailyrollup table (one upsert-increment per request, no per-event rows).cf.country), UA class (camo/bot/browser/other), and a 200/304 flag. No IPs, no raw UAs.PUBLIC_URLand the current request host — coverslocalhost:8787duringwrangler dev) are filtered out before logging.Honest about the limits up front in the panel copy: SVGs are cached 5 min at the edge and GitHub Camo fronts README embeds, so totals undercount — referer/country mix stays meaningful.
Test plan
npm run db:migrate:localthennpm run dev, hit/:slug/chart.svgand/:slugfrom an incognito tab, verify the Audience panel populates while signed-in-owner views don't.cached(304).localhostandstars.wavekat.comnever show up under Top referers.npm run db:migrate) before deploying.🤖 Generated with Claude Code