VIewsLifeTime - How to fetch User account details?


  • Hi,

    I want to display Site visitors count in my sharpoint home page. Using REST api (http://<siteurl>/_api/search/query?querytext) i got the count from "ViewsLifeTime" property. It's showing total visitors count till date. But i want to get user id's (user account) details . Is there any way to get the user account details pertaining to the page count?

    Thanks in advance.

    Thanks, Suresh

    • 편집됨 Suresr 2018년 5월 18일 금요일 오전 9:03
    2018년 5월 18일 금요일 오전 9:01


  • Hi Suresh,

    Per my knowledge, there is not an API to achieve it. As a workaround, we can create a custom list(PageUrl, HitCount,UserId), then add some JavaScript into master page to achieve it.

    Get the current url using window.location.href and get current user id using  _spPageContextInfo.userId, then set the data into the custom list using jQuery Ajax and REST API.

    SharePoint 2013: CRUD Operation On List Items Using REST API Services

    Then get the report base on the custom list and show it in Home Page.

    Best Regards,


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • 답변으로 표시됨 Suresr 2018년 5월 21일 월요일 오전 7:15
    2018년 5월 21일 월요일 오전 7:05

모든 응답