1

I need to display the following text in a web part:

Your profile has been viewed by X people in the last 90 days

How can I determine the value of "X" using JSOM?

If this isn't possible, I probably could get away with changing the web part to display the following text instead:

X people have searched for your profile in the last 90 days

In this instance, I'd need a way to determine the number of searches for a specific string (e.g. "John Doe") in a set period of time using JSOM. Obviously, this method has some flaws as it doesn't take into consideration phonetic name searches (i.e. "Nick vs Nicholas", partial name searches or actual click-throughs) -- which is why it's my second preference.

Ideas anyone?

  • It's worth noting that this type of info is definitely calculated and stored within SharePoint somewhere, as it's displayed in the people search results when you search for yourself (as "Number of searches that led to you"). – Nick Larter Sep 24 '13 at 10:26
  • The number of searches is calculated from "Clicks". You may find tha analysis DB is storing page views for the People.aspx page and from the parameters can figure out who is being looked at. – Matthew McDermott Sep 24 '13 at 22:51
2

You should be able to use the Search API to get a users ProfileViewsLastMonth and ProfileViewsLastWeek information.

Here is a REST example:

/search/_api/search/query?querytext='Elliot Wood'&sourceid='B09A7990-05EA-4AF9-81EF-EDFAB16C4E31'&selectproperties='ProfileViewsLastMonth,ProfileViewsLastWeek'

sourceid='B09A7990-05EA-4AF9-81EF-EDFAB16C4E31' is People Search

  • These values always seem to be nulls / zeros. Any idea why? – Nick Larter Sep 27 '13 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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