For my blog, I would like to filter my articles according to the most viewed. For this, I was thinking of getting this information from the Matomo plugin. It shows the page views in the panel for each individual page, but I haven’t found a way to load this info into a variable.
The optimal way would be something like “$page->matomoViews()”, but I’m pretty sure, there is no official method for that.
The plugin just displays information it gets from your Matomo instance, so none of this information is stored locally.
You can probably use the routes the plugin comes with to get the data you need. Then it would probably make sense to cache it, so you don’t make a call to the API every time you want to show your articles.