Forum Discussion

Christian Enghaug's avatar
Christian Enghaug
Brass Contributor
Aug 26, 2016

Using search to display usage statistics in SPO

Hi all,

I'm looking into using seach api or just search web parts to display usage statistics like most popular/viewed articles in a publishing portal in SPO. When I look at the search schema I find some promising managed properties, as you can see at the bottom of this post.

First: 
From what I learn in https://technet.microsoft.com/en-us/library/dn794239.aspx, the Recent time period, as in ViewsRecent, is by default set to the last 14 days. Is that still the case in SPO? Is there a way to change this time period with CSOM?

Second:
Is there any documentations of these managed properties and usage? Is the number values returned in these properties realtime, or is the number populated by the crawler?

Third:
Is there any other approch i can do to display these types of usage data? I looked into the https://msdn.microsoft.com/en-us/office-365/office-365-management-activity-api-reference but that does not seem to be suitable for this use case (?).

In search schema:



In search result:




4 Replies

  • For an overview of the on-prem architecture, please review the following:

    The SPO Search service works similarly.

     

    Regarding your points:

    First: You will not be able to change the SPO property. It is a service-wide setting, not per-tenant.

    Second: I couldn't specific documentation of the managed properties, but the names match the information described in the Analytics Platform documentation linked above. Usage data is pushed into the search index every 15 minutes.

    Third: These properties are your best approach using OOB functionality. Of course, you could add a javascript widget (Google Analytics or Application Insights) to your pages.

     

      • Franck Cornu's avatar
        Franck Cornu
        Brass Contributor

        Hi Christian Enghaug

         

        If you want to view analytics and usage for your SharePoint site, like paulschaeflein says, you can use Azure Application Insights. I used this feature for one of my project and it is really simple. You can either add the generated code into a script editor Web Part or use a https://github.com/OfficeDev/PnP-PowerShell/blob/master/Documentation/AddSPOJavaScriptLink.mdto inject the code for all pages. Just follow this procedure https://azure.microsoft.com/en-us/documentation/articles/app-insights-sharepoint/.

         

        I think using search may be too complicated for what you looking for.

Resources