Contents
Another Interesting fact is that, OOTB News web part also shows Page view count. When I checked the fiddler traces, It basically uses Search query to fetch News pages, but to fetch View count it uses Microsoft internal api again.
For SharePoint Online, set the appropriate Site Collections to be re-indexed. More information on SharePoint Managed Properties can be seen here. There is a JavaScript variable called – ‘ _spPageContextInfo ’ available within a SharePoint page using which we can get the GUID of the current page.
Is there an API to fetch page views?
But In Social bar Page view, it basically uses Microsoft Internal api (based on fiddler traces ) to fetch Page views (not sure where/how it is being processed).
Is there an API for page view count?
As per the information received by Microsoft support, Microsoft api which fetches Social bar Page view count is not Public api (at least for now), so there is no Official documented api present yet. I am yet to add a User voice for this (I will do it soon). Another Interesting fact is that, OOTB News web part also shows Page view count.
Pages are located under Site Pages, and this page is called PnP-Demo.aspx There’s no likes or comments yet ( assuming you’ve enabled the comments!)
How to get view count, like Count and comment count?
I know that the view count is possible to get via the search api and the like count via the list/getByTitle function of the REST api. However after hours of research and trials I haven’t been able to
I am trying to retrieve the number of views of SharePoint page. After searching on google I found a javascript that gets the number of views using JavaScript with the help of ViewLifeTime property. After debugging I found out that there are no ResultRows in ResultTables.
How to get number of views in JavaScript?
After searching on google I found a javascript that gets the number of views using JavaScript with the help of ViewLifeTime property. After debugging I found out that there are no ResultRows in ResultTables.
How to show page views in SharePoint farm?
We need a managed property to query based on the page’s GUID. Within the Search Schema of your SharePoint Farm, create a managed property with the following details. After creating this Managed Property, start a full crawl of the appropriate content source/s. For SharePoint Online, set the appropriate Site Collections to be re-indexed.