Question

I've just noticed in SPO in Office 365, in the pages library they show page views.

SPO Page Views

Any ideas how one would go about getting that via REST or another method to display that in the page layout?

Was it helpful?

Solution

Use REST API and managed properties to get page views

For recently viewed page you can use "ViewsRecent" and while "ViewsLifeTime" is update every 14 or 15 days.

You can use SharePoint 2013 Search Query Tool to generate REST queries on the fly and refine searches

enter image description here

https://some-SharePoint-online-tenant.sharepoint.com/_api/search/query?querytext='*'&rowlimit=10&sortlist='viewsrecent:descending'

Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top