1

I'm nearing completion on my organization's SharePoint site and was asked to find a way to show a report that indicates usage. Not just the simple view count report that is built-in, but rather a report that displays users and their view count/view date.

I am looking for both, entire page views and individual webpart views. Is there anyway to do this with the Out-of-the-Box platform? I'm not looking to spend additional money.

Thank you,

1 Answer 1

1

I am looking for both, entire page views and individual webpart views. Is there anyway to do this with the Out-of-the-Box platform? I'm not looking to spend additional money.

You can do it for free, only some JavaScript coding required,
no need for SharePoint Designer or Powershell or back-end code

JSLink

Since SP2013 you can add JSLinks to WebParts and Views

Basically they are just Javascript files that get executed when something is displayed.

Terms JSlink/CSR are used interchangeably, strictly speaking:

  • a CSR (Client Side Redering) file: changes the HTML of SharePoint elements

  • JSLink: when this WebPart/View/Form is displayed use CSR file

So JSLinks can point to any JavaScript code, don't have to be CSR code files!!
(on SharePoint Online they can even point to any external file
Theoretically I could now give you the URL of our 365CSI TrackerJS file and it would do anything you asked for (including creating the required List in your own Tenant) ... but this is code for clients and you did not want to spend anymore 💸💸💸

Counting View displays per User

  • Create a List ViewCount with only default Columns: Title, Created, Created By
  • Attach a JSLink to your Views
  • The JSfile
    • (using JSOM or REST) Writes the View Title to the ViewCount Title column
      (Created and Created By are set by default)

The Chrome Browser Extension Cisar (by the One and Only JS-Wizard Andrei Markeev) makes creating a CSR file a breeze (but your code is not doing any Client Side Rendering...)

Only thing with Cisar, it adds the JSLink to the WebPart, NOT the View, which won't make any difference for ListView Pages; only when you add a WebPart to an exiting ASPX page and re-use an existing View, you need to set the JSLink (on that new WebPart) by hand

Actually, you don't want to set the JSLink on the View... SharePoint ignores any View JSlinks when there is a JSLink set on the WebPart... So if any other (3rd party) code adds a JSLink on the WebPart... your precious View-JSLinks will NOT execute.

More CSR / JSLink blogs

Support Tools

  • BookMarklet iCSR Link Manager update JSLink settings on WebParts & Views, deploy JS files to Style Library; and UserCustomActions Manager

  • (Chrome Browser Extension) Cisar Edit CSR files with Live Updating

  • (Chrome Browser Extension) Chrome SP Editor Edit SharePoint files, add ScriptLinks to SiteCollection/Webs, manage Web Property Bag

One code file to rule them all.. even on SP210

UserCustomActions (available since SP2010) are very powerful, basically the same as adding a script file to the MasterPage: One JavaScript files gets executed on every page

So you can, Big Brother, Track everything you want...

... not everything on Office365...

FYI, For now, The Office365 New Experiences (Document Library, List, site Contents) do NOT allow any custom code, no CSR, no UserCustomActions, no branding, no MasterPage, no... etc.

Be sure to check the Blogs after Microsoft Ignite conference (sept 26-30) on this topic

iJS iCSR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.