chore(metrics): capture top referrers + paths weekly (durable attribution)#182
Merged
Merged
Conversation
…tion) GitHub's Traffic API exposes top referrers and top viewed paths only as a 14-day, admin-only, top-10 point-in-time view — the single most useful signal for "which channel drove this wave" (Google / Reddit / chatgpt.com / a directory), and the first to vanish. metrics.yml now also appends them to two long-format CSVs so a channel's trend survives across weeks: - metrics/referrers_log.csv — date, referrer, count, uniques - metrics/paths_log.csv — date, path, title, count, uniques Blank-tolerant (default [] on a 403/no-PAT run -> zero rows, header still written; existing header never duplicated); @csv quotes fields safely; the weekly commit step adds both new logs. Seeded with the 2026-06-22 snapshot so the current wave is preserved immediately rather than waiting on the next cron. IMPACT.md updated. Co-Authored-By: Claude Opus 4.8 <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.
Capture top referrers + paths weekly (durable attribution)
Adds the one piece of adoption telemetry that was being lost: where each traffic wave comes from.
Why
GitHub's Traffic API exposes top referrers and top viewed paths only as a 14-day, admin-only,
top-10 point-in-time view. That's the single most useful signal for "which channel drove this"
(Google / Reddit / chatgpt.com / a directory / arXiv) — and the first to vanish.
metrics.ymlalreadylogged view/clone counts but not the source, so referrer attribution evaporated every 14 days.
What this adds
metrics/referrers_log.csv—date, referrer, count, uniquesmetrics/paths_log.csv—date, path, title, count, uniquesBoth are long format, so a channel's trend pivots cleanly over weeks (e.g. is AEO traffic from
chatgpt.com/perplexity.aicompounding?). The weeklymetrics.ymlrun now also appends to them.[]→ zero rows, header still written; the existingheader is never duplicated.
@csvquotes every field (comma-safe). No commit-loop (the workflow runson schedule/dispatch only, with
[skip ci]).waiting on the next cron — e.g. referrers Google 337/172, github.com 254/124, reddit.com 77/34,
chatgpt.com 45/27, threads/linkedin/bing/perplexity/claude/facebook.
IMPACT.mdupdated to document the two new logs.Verification
Capture logic tested against the live Traffic API (exact
jq | @csvoutput); CSVs parse cleanly(uniform columns). Adversarially reviewed: header guards always create both files before the commit
step (incl. the no-PAT path),
jqemits zero rows on[]/{}, no commit-loop, no PII (domains + repopaths only).
gen_distribution_manifest --checkunaffected (metrics/is not part of the install payload).No skill / detector / version change.