1

Is there a way to get the total number of page views of a page in SharePoint using Rest API or JSOM?

I tried using Search API

http://SiteUrl/sites/_api/search/query?querytext='home'

But in all the results, the ViewsLifeTime is null I enabled search and crawl for the managed property (ViewsLifeTime) and ran a full crawl as suggested here, but still the values were null.

Also the ViewsRecent column is null as well

Is there any other way ? Am I missing something like a mapping?

  • ViewsLifeTime is updated around every 2 weeks while ViewsRecent shows visitors of the recent time span. Have you had your page at least for the couple of weeks so that ViewsLifeTime could have received some value? – moe Jul 26 '18 at 5:23
  • Yeah the page has been there for almost a month now. but I've enabled search & crawl in the managed meta data only today, does that matter? – Vignesh Subramanian Jul 26 '18 at 5:24
  • ViewsRecent also returns null value. Not sure what I am missing – Vignesh Subramanian Jul 26 '18 at 5:46
  • 1
    Yes it probably does matter that it's been put under crawling only recently. – moe Jul 26 '18 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.