简体   繁体   中英

Sharepoint 2010: Tracking Clicks on Link to a Document Content Type: Store and Update Values in a Custom List by using jQuery.

Due to several system limitations (IE8, structure of our sharepoint setup, etc...) we are unable to use the standard site analytics webpart featured in SP2010 to generate a ranking of most viewed files within any given scope of a site collection. Additionaly, all of our sharepoint libraries that are publicly visible are only accessible by means of a shortcut, ie they are all of the "link to a document file type". I was wondering, if anyone has experience in accomplishing the following by means of jQuery or Javascript:

  1. Register Click on any given "Link to a Document" within any Library of a given page
  2. If it is the first time that link was clicked on: Store Name of the File Shortcut in a previously created list and set "nr. of clicks" value to 1
  3. Anytime a shortcut is clicked on again: update the value (=Nr. of clicks) in the created custom list.
  4. Sort the list by most frequently clicked shortcuts.

The goal is to provide users with a top 10 list regarding most frequently viewed files on any given sharepoint site.

Thanks upfront for any support at all!

I would create a JavaScript file and reference it in the master page you are using to accomplish what you just described.

Register an event on the button click, find the item in the list with the url of the link to new item, if it exists, add 1 to them value of clicks, if not then create the item with value of Clicks to 1.

The sorting would be achieved by creating a view (in list settings) which sorts the list by the value of clicks, descending.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM