0

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.

2
  • Please confirm that you are getting results from SPWeb.GetUsageData(); as in my environment it is returning a null datatable. I can see that usage timer jobs are running on my SP 2010 environment.
    – user14933
    Feb 15 '13 at 11:05
  • SPWeb.GetUsageData(); is returning null for me also Jan 16 '17 at 12:48
0

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.

2
  • 1
    thanks. if i do that how it's gonna affect on this method or some other programmatically way to get more than 30 days? Jul 20 '11 at 3:46
  • To get all usage data, you can use the GetUsageBlob Method using RPC calls. It's a bit ugly, but I don't have a better answer.
    – Robert
    Jul 20 '11 at 16:59
0

Change the retention period with following command:

Set-SPUsageDefinition -Identity "Page Requests" -DaysRetained 31
3
  • thanks. if i do that how it's gonna affect on this method or some other programmatically way to get more than 30 days? Jul 20 '11 at 3:48
  • Well you can retrieve for more than 30 days if you configure share point to retain for kore than 30 days.. Jul 20 '11 at 12:19
  • in the SPWeb.GetUsageData() method i have two choice for date, one is "day" and the other "lastMonth", and it's obvious that it will return for the last 30 days of reports. but thanks anyway i figure it out. Jul 21 '11 at 16:42
0

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.

1
  • 1
    if anyone wanna know all sort of things that i did just comment me. Jul 25 '11 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.