This blog post is a contribution from Aaron Miao, an engineer with the SharePoint Developer Support team.
In a scenario that you want to render Web Analytics report data to your favorite format, you need to retrieve the report data. There’s no document on how to retrieve SharePoint built-in report data. Some online articles are suggesting retrieving data directly from Web Analytics reporting database. It’s not recommended. Even with this approach, often customer faces issue of getting AggregationId which is required to retrieve data from database.
Here’s the sample code that can be used to retrieve Web Analytics report data.
AnalyticsReportFunction ar = new AnalyticsReportFunction();
object[,] result = ar.GetWebAnalyticsReportData(
"2", // Report level,
"TopPageForPageReport", // Report name,
DateTime.Today.AddDays(-30.0), // Start date,
DateTime.Today); // End date,
In the above, the Report level parameter is shown below:
And the Report name parameter is shown below:
Here’s what is returned
And here’s what you see from UI (WA report)
Nice post, I'll need to try this out!
your post is very good .
i have a question, how to get FAST Search Connector Crawl Log or History?
however the CrawlLog Class methods is obsoleted , please help if you have any answer .
Nice Post. Do you know the client side API for Usage Analytic report data in SharePoint 2013 ? I have a requirement to show the page views in custom developed apps. let me know your views if you can.
Web Analytics has been changed in SharePoint 2013 significantly. Please check out the followings articles for details. Haven't got chance to research how you can bring those limited reports in an app.
nice post,i need to get same in sharepoint2013,if u have code pls share.i know this feature is removed in Sp2013,it is merged with search service application.but i m not knowing how to get in SP2013.i tried below linked post but no usehttp://social.technet.microsoft.com/Forums/sharepoint/en-US/06e00842-6517-443f-866f-f91eae396f17/how-get-toppageforpagereport-programmatically-in-sharepoint-2013?forum=sharepointsearch