Add portfolio analytics page across all properties - #190
Merged
Merged
Conversation
The per-project stats page answers "how is this site doing?"; there was no way to ask "how is the whole portfolio doing?". /analytics rolls every project the viewer can see into one view and, for each figure, compares the last N days against the N days before them so the answer is explicitly up, down, or sideways. - Multi-project tracker_* RPCs (security invoker, so RLS still scopes them). Aggregating the whole set in one query rather than merging per-project calls keeps the top-N rankings correct: a bucket ranked 11th on ten sites can be #1 overall and would otherwise never surface. - tracker_project_totals returns current AND previous window per project, which drives both the headline trend chips and the per-property table. - tracker_project_daily_series is the only projects x days query, so callers pass a narrowed id list; the chart's "Other" band is derived by subtracting the charted sites from the exact full-portfolio series. - Top pages / exit pages / interactions group by project as well as path, because "/" exists on every site and collapsing them means nothing. - buildDaily() moved to lib/tracker/series.ts and is now shared with the per-project page instead of being duplicated. Selectable 7/30/90-day window and an org filter that defaults to all orgs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan50 finding(s) HIGH/CRITICAL: 4 | MEDIUM: 43 | LOW: 3
Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
The per-project stats page answers "how is this site doing?"; there was no way to ask "how is the whole portfolio doing?". /analytics rolls every project the viewer can see into one view and, for each figure, compares the last N days against the N days before them so the answer is explicitly up, down, or sideways.
Selectable 7/30/90-day window and an org filter that defaults to all orgs.