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?

2
  • 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").
    – user4545
    Sep 24, 2013 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. Sep 24, 2013 at 22:51

1 Answer 1

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

1
  • These values always seem to be nulls / zeros. Any idea why?
    – user4545
    Sep 27, 2013 at 7:20

Your Answer

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