Do stats collection from Netlify in aggregate #13
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.
This is the laziest way to get all the Top Pages info, quick Ruby script I threw together.
Future enhancements could include going back to get older data, or some improved slicing and dicing/visualization of the data. Unfortunately what we've learned from looking over the data this once is that Netlify only provides analytics about the top 10 pages each day.
So unless something made it to the Top-10 list on at least one given day, it won't show up on this list at all.
Still, better than nothing! Here is the output from running this script today, in the future I imagine we have something better to report on aggregate statistics over arbitrary spans and this goes away completely.
We can run this script again tomorrow and it will show 44 days of accumulated data, the day after we'd get 45... it's all based on when we started taking snapshots of this information, as it scans through each git commit we've made through automation every day, where we got the numbers from the netlify "pages" metric.
I think that Netlify actually keeps the data for longer than 30 days, we just need a way to add them to the git history that won't be too impossible to sort out later, (we could just add a script to go back and poll the rest of the days we've missed since the first of the year... depending on when we did enable analytics and how interested we are in that historical data!)
I realize this is not the easiest way to consume this information but we have limited capabilities in terms of what we can access from this API, what we've planned for, and what else has been done for us upstream already at NiklasMerz/netlify-analytics-collector. Most of this work was done already there.
The next obvious step to enhance would be to see how much further back we can go. I think the 30 day limitation is imposed by the GitHub action and how it works, not by Netlify's upstream API, (but I can't be sure without spending some more time on it and trying to write my own API client next. That doesn't sound like too much work, maybe one for next week...)