Skip to content

ITProCorner/Simple-SharePoint-Metrics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple-SharePoint-Metrics

We can use SharePoint Search, to provide a simple metrics overview about the usage of our site and content. This sample will show the steps.

First create a new library named "Scripts" in the site collection that should be used. Copy the content of the folder "Header Scripts" of this repository to this new library.

Upload the js-files from the folder "Display Templates" to folder "Display Templates/Search" in the Masterpage gallery. You can upload them directly to this folder or you can create a separate subfolder (I prefer using a subfolder). After the upload, set the metadata for each of the js-files as shown in the following image (the Title field should match the uploaded js-file ;-)).

The value for the field "Managed Property Mappings" could be taken from the corresponding html-files.

Next create a new Wiki Page in the Pages library. Put a Search Box webpart, a Content Editor webpart and a Search Results webpart to this new page.

Configure the Content Editor webpart to use the corresponding header-file from the library "Scripts" for your needs and set the webpart to not show a title.

Configure the Search Results webpart to use the query "Path:{searchboxquery}" and configure the Display Templates section to use one of the uploaded display templates, corresponding to the used header-file in the Content Editor webpart.

Save the wiki page, enter a site url in the search box and click the search icon. This will show the results for this site and the content below the entered web address.

By configuring the Search Results webpart with additional query settings, it is possible to limit the search results. For example to show just the usage of the Site Pages.

The prepared display templates and header scripts can show

  • lifetime visits and recent visits
  • visits of the last 7 days
  • visits of the lat 3 months

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 51.3%
  • HTML 48.7%