Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Set up chart view statistics #1613

Merged
merged 10 commits into from
Jun 17, 2024
Merged

Conversation

bprusinowski
Copy link
Collaborator

@bprusinowski bprusinowski commented Jun 13, 2024

Closes #1611
Contributes towards #1596

Chart view analytics

This PR sets up a new ConfigView table in our database which is used to track the chart views. We store every chart view, to potentially be able to make use of this information in the future and e.g. show charts trending in the last week or month, to understand at what time of the day the charts are viewed, how the metrics are influenced by e.g. Open Linked Day events, etc.

A chart view is counted when:

  • there's a visit to /v/ page,
  • there's a visit to /embed/ page,

or precisely, when getServerSideProps function is triggered for these pages.

View statistics

There's also a new card that shows statistics on views in the Statistics page (see this link). The card will be shown when the first views are recorded in the database (the screenshot comes from my local development environment).

Screenshot 2024-06-13 at 15 26 08

@bprusinowski bprusinowski requested a review from ptbrowne as a code owner June 13, 2024 12:08
Copy link

vercel bot commented Jun 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 17, 2024 8:23am

Copy link
Contributor

@adintegra adintegra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀 Thanks!

@bprusinowski bprusinowski merged commit f9ba4fc into main Jun 17, 2024
5 of 7 checks passed
@bprusinowski bprusinowski deleted the feat/set-up-chart-view-statistics branch June 17, 2024 08:36
@Rdataflow
Copy link
Contributor

@bprusinowski is it possible to get frequency per chart_key for the most frequently visited charts with this?

@bprusinowski
Copy link
Collaborator Author

bprusinowski commented Jun 19, 2024

@Rdataflow yes, we'd need to add a dedicated route to be able to retrieve such information directly from the application. Are you thinking about this in context of Varnish cache invalidation, or to add this to the Statistics page?

Addition of this logic is a next step for managed cached endpoint PR 👍

@Rdataflow
Copy link
Contributor

@bprusinowski great. I was thinking of it mainly for varnish and internal statistisch use👍️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up basic analytics on chart views
3 participants