how can i get more than 30 days of Usage Report Data from SPWeb.GetUsageData() method?

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/16391

  •  16-10-2019
  •  | 
  •  

Question

I wanna create web part that shows all of the report since Sharepoint Web Analytics start to work.
But as far as i know, i have one choice and its SPWeb.GetUsageData() method and this method only return the last 30 days of reports.
I know Sharepoint itself has a webpart for this but i want more info which is not in the web part.

Was it helpful?

Solution 3

The only way that i came upon with is to reach the data directly from the Analytics Database of the SharePoint and do just reading from "WATrafficAggregationByDate" table.

OTHER TIPS

To capture usage data from a longer time period, you have to modify the settings of your "Web Analytics Service Application". You can find the settings in your service application management, select the application and click "Properties" in the ribbon. You can define a data retention period from one month to 25 month.

Change the retention period with following command:

Set-SPUsageDefinition -Identity "Page Requests" -DaysRetained 31
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top