Add detailed public metrics view for published projects#2557
Merged
lukepayyapilli merged 4 commits intoMIT-LCP:devfrom Jan 20, 2026
Merged
Add detailed public metrics view for published projects#2557lukepayyapilli merged 4 commits intoMIT-LCP:devfrom
lukepayyapilli merged 4 commits intoMIT-LCP:devfrom
Conversation
faf41ae to
c3d7275
Compare
tompollard
reviewed
Jan 15, 2026
Member
tompollard
left a comment
There was a problem hiding this comment.
Thanks again Luke. I added a couple of quick comments but would like to take a deeper look later!
tompollard
reviewed
Jan 15, 2026
Contributor
Author
|
Thanks for the review @tompollard! These are great improvements. I've addressed your feedback:
The view is now much cleaner and delegates to these model methods. Let me know if there are other improvements you'd like me to make (e.g. add additional visualizations or aggregated metrics etc.) - thanks! |
9218a2f to
ffb8555
Compare
tompollard
requested changes
Jan 15, 2026
Contributor
Author
|
Apologies @tompollard - I missed some inline imports in the model methods. Fixed now by importing |
tompollard
reviewed
Jan 16, 2026
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
view_count(),views_by_version(), andviews_over_time()methods to PublishedProject model.unique_viewers_count()andunique_viewers_by_month()methods to AccessLogQuerySet.published_project_metricsview using model methods./content/<slug>/metrics/<version>/.Approach
Created a dedicated metrics page accessible from the Project Views card in the sidebar. View counting logic is encapsulated in PublishedProject model methods (
view_count(),views_by_version(),views_over_time()), which delegate to AccessLogQuerySet methods for the actual queries.Reasoning
unique_viewers_by_month()counts unique viewers per month (same user viewing in multiple months is counted once per month).Screenshots
Part of #2336