-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API for fetching Modern Page views count #2808
Comments
It should have not specific official API for your requirement.
|
Hi @Seiyasu, A great THANK YOU, exactly what I am looking for, I admit I am not an expert in Search API, I've seen this when googling but only with the ViewsLifeTime property that its value didn't match the number of views displayed in the modern page ! I was really confused ! You rock, thanks again ! [EDIT] Just out of curiosity where did you find the "ViewsLifeTimeUniqueUsers" property ? |
Hi @Seiyasu, Can you please provide more info on below ? |
@jashwanthreddyn
If you set a managed property to be searchable, the content is added to the index. This means that a simple query for "Smith" returns items that contain the word "Smith" and also items whose "author" property contains "Smith". If you want users to be able to "only search for items that have this specific author", set the author property to be queryable. Then, to find only items that have an author named Smith, users can query for "author:Smith". For some case, you just use Retrievable is OK too.
I haven't try just use the continuous crawl. Just my understand, the continuous crawl is called too often, use the full crawl with rules when we need to crawl, then update the index is enough, there is no need to run the continuous crawl in many case. https://social.technet.microsoft.com/wiki/contents/articles/15571.sharepoint-2013-continuous-crawl-and-the-difference-between-incremental-and-continuous-crawl.aspx |
Hi guys, Allow me to reopen this issue, actually yesterday morning the number seemed to match but then in the afternoon any value I could fetch from the Search API (that seem to relate to page views) don't match the value displayed in the modern page !! I don't know if the Modern Page uses some caching or uses another property to display... Does anyone know further about it? another property to use? another technique to fetch or compute the value displayed in the modern page ? Best regards, |
Hi Yannik, I had done some analysis on this as we had the same need as you (and I created #2503). You created/edited a modern web part using the managed properties ViewLifeTime, ViewLifeTimeUniqueUsers and ViewsRecent, are not the same properties used within the Social bar, that is using a different source. The reason of this behavior is that, classic usage and modern (on the social bar) are from two different sources and we cannot make any comparison between each other. So, technically its stored or processed from different places. Search query gets it from Search index, Another Interesting fact is that, OOTB News web part also shows Page view count. When I checked the fiddler traces, It basically uses Search query to fetch News pages, but to fetch View count it uses Microsoft internal api again. So OOTB news web part apparently not use Search Managed property (ViewLifeTime, ViewLifeTimeUniqueUsers). Thanks, |
Hi @gurubn, Exactly what I supposed and why I initially posted this issue... Many thanks for your help and feedback ! |
You should also take a look at these new Beta Microsoft Graph APIs that will likely be what you want long term: |
Hi Jeremy,
Thanks for the info, unfortunately it doesn’t help on immediate term since it is beta, but a least I know what to watch for my customer’s needs :)
Thanks a lot!
|
Closing as an entry which has now a user voice entry and also upcoming API from Graph. |
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues |
Category
Observed Behavior
Hi,
I initially posted a reply to the thread #2503 but I think it deserves its own thread
I have some requirements for a custom development, and I need to fetch the count of views of a modern page in my SPFx WebPart. I did some search but haven't found anything relevant so far...
Does anyone know if there is any official API to fetch this value, or at least can anyone tell where (or how) it should be fetch (maybe using the search API ?)
Best regards,
Yannick
The text was updated successfully, but these errors were encountered: