I'm developing a asp.net website that will have a list of the top 10 accessed website on the client's sharepoint site.

Is there a way that i can generate a XML file containing the information i need, much like the list on the Sharepoint Web Analytics? (http://vm-sharepointapp:8080/_layouts/WebAnalytics/Report.aspx?t=TopPageForPageReport&l=wa&id=http%3a%2f%2fvm-sharpeointapp%2f&WebAppName=SharePoint%20-%2080)

That way my asp.net application can read this XML file and publish it on the website.


1 Answer 1


Please note, that you can run analytics reports at one of 4 different scopes: Farm, Web Application, Site Collection, and Site. The Farm/Web Application scoped data is available via Central Administration. The Site Collection/Site scoped data is available within each Site Collection/Site.

Based on the url you have shared, it appears that you are trying to get at a Web Application's "Top Pages" report (via Central Administration).

The bad news is that this data is not available through any APIs, nor is it stored in a database where it is supported to be queried directly. The best you could do is export this to a Spreadsheet (using the Analyze tab in the Ribbon). After it's in the Spreadsheet you have a few options, none of which are fully automated:

  1. Upload it to a content area and access the data in it via Excel Services APIs.
  2. Import the data into a (SQL) database that you own and can write your own queries against.

Use a tool like Fiddler to see if you can get at the Web Request being generated to Export the spreadsheet. This may help in getting it more automated.

Remember, by default, the data in this report is updated nightly, so you whatever you come up with your users will be looking at day old data, so you don't need something pulling "live" data.

If you are curious about this, and want to see where the data is coming from, you can do some detective work to track this down. For example, turn on SQL Profiler and trace the queries. It should be pulling from the Web Analytics Reporting (not Staging) DB. Please note, however, that it is not supported to read from the Web Analytics database. Doing so can cause harm to your farm and leave you in an unsupported state. It is only supported to directly query the Usage and Health Data Collection database in SharePoint:

http://technet.microsoft.com/en-us/library/cc678868.aspx#Section1 http://support.microsoft.com/kb/841057

  • Thanks a lot for the information, Brian. It's kinda sad though, that Microsoft doesn't give us a API to access that information. I'm checking the possibility to develop some sort of 'hit counter' and put it on the master page, and this, let's call it 'thing' would save the URL in a list or database and then i'd be able to check the top visited pages in a easy way without doing anything 'wrong' with Sharepoint. Mar 5, 2012 at 14:22
  • If you are tracking page views, I don't know about a SharePoint list to store that data. Why not leverage one of the analytics frameworks out there, like from Google: google.com/analytics? I think you can get at them free/cheap, and all you need to do is insert a little javascript into your master page (or page templates that render the pages you are interested in tracking).
    – Brian
    Mar 6, 2012 at 17:37
  • Also, this is a great read and may also be helpful if you don't want to go with an existing service: todd-carter.com/post/2011/04/26/…
    – Brian
    Mar 6, 2012 at 17:37
  • Remember, by default, most of the _layouts pages use the same master page as regular content pages. So, when navigating settings pages, you could skew your page hit/site usage stats. Might be helpful to turn off the setting that allows your _layouts pages to use the same master page, or in your master page detect if you are in _layouts, then register the "hit" or "view".
    – Brian
    Mar 6, 2012 at 17:41

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.