In SharePoint 2010 it was possible to obtain reports from web analytics programmatically using Microsoft.Office.Server.WebAnalytics.Reporting.AnalyticsReportFunction class.However, in SharePoint 2013 the Web Analytics Service Application was merged into the Search Service Application. It seems now that the old assemblies used for this (Microsoft.Office.Server.WebAnalytics.dll and Microsoft.Office.Server.WebAnalytics.UI.dll) are not available any more.
In SP 2013 UI, the reports are available at these locations, as “Usage Reports”
- CA->Application Management->Manage Service Applications->Search Service Application->Usage Reports
- Site Settings -> Site Administarion ->Popularity Trends -> View Usage Reports
These reports can now be obtained programmatically using SearchServiceApplication class, from Microsoft.Office.Server.Search.dll. There are two methods available for these:
Although there are more reports that can be obtained from the SSA, i will only explain these two options.
Search analytics data is kept in a SQL database – AnalyticsReportingStore. GetSearchReport is based on SQL stored procedure ar_procGetTopSearchReport and GetRollupAnalyticsItemData is based on ar_procGetAnalyticsItemData.
GetSearchReport has the following parameters:
- reportType – int :…
View original post 185 more words