Over the past few months I’ve had 2 customers that have run into an scenario where the SharePoint 2013 web analytics usage reports have no data (all zeroes) in the reports. While working with some brilliant Microsoft escalation engineers (thanks Anthony and Jason) we were able to run some PowerShell scripts that added receivers to start data showing again on the following day. Since I haven’t seen any posts on this as of yet I thought I would post a version of the PowerShell scripts we used.
Scenario
In SharePoint 2013 the search service application incorporates web analytics (which is a separate service application in SharePoint 2010). Web analytics processes usage logs on the SharePoint machines and generates reports on a daily schedule. These reports can be viewed for an individual site in the site settings under Site Collection Administration > Popularity and Search Reports.
In the Popularity and Search Reports you can click on the Usage report which will launch an Excel workbook.
What I found with 2 customers and one of my lab farms was that the Usage report contained all zeroes for data even though the customer (and me in my lab farm) had been using the site regularly with multiple accounts over the past few days.
We analyzed the logging database and found that it had usage data, but the search analytics database did not. (Note: do not directly query the search analytics database as that is unsupported as of the time this post was written. See http://technet.microsoft.com/en-us/library/cc678868.aspx for more information.) So it appeared the data in the logging database wasn’t being processed by the search service web analytics timer jobs. After verifying that the timer jobs were indeed running the long road of PowerShell queries into the system began. We finally used the below commands to arrive at what we believe to be the culprit for these customers. Our findings follow the commands.
$aud = Get-SPUsageDefinition | where {$_.Name -like “Analytics*”} $aud | fl $prud = Get-SPUsageDefinition | where {$_.Name -like “Page Requests”} $prud | fl
- AnalyticsUsage usage definition had no Receivers defined
- PageRequest usage definition had no Receivers defined
Not having any Receivers defined also led to the EnableReceivers property to be set to false for both.
Workaround
The workaround in these scenarios was to manually create the Receivers. The PowerShell commands to do so is below (slightly modified to check for empty receivers first). Again this sample script is provided as-is with no warranty. Do not run this in your environment without first testing. This is not an official Microsoft approved script. You can download a copy off my SkyDrive folder as well.
if((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell) -eq $null) { Add-PSSnapin Microsoft.SharePoint.PowerShell } $aud = Get-SPUsageDefinition | where {$_.Name -like “Analytics*”} # if analytics usage definition receivers is empty then manually add back receiver if($aud.Receivers.Count -eq 0) { $aud.Receivers.Add(“Microsoft.Office.Server.Search.Applications, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”, “Microsoft.Office.Server.Search.Analytics.Internal.AnalyticsCustomRequestUsageReceiver”) } # if analytics usage definition receiver is not enabled then enable it if($aud.EnableReceivers -eq $false) { $aud.EnableReceivers = $true $aud.Update() } $aud | fl $prud = Get-SPUsageDefinition | where {$_.Name -like “Page Requests”} # if page requests usage definition receivers is empty then manually add back receiver if($prud.Receivers.Count -eq 0) { $prud.Receivers.Add(“Microsoft.Office.Server.Search.Applications, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”, “Microsoft.Office.Server.Search.Analytics.Internal.ViewRequestUsageReceiver”) } # if page requests usage definition receiver is not enabled then enable it if($prud.EnableReceivers -eq $false) { $prud.EnableReceivers = $true $prud.Update() } $prud | fl
After the script has been run the output from the prior commands can confirm that Receivers have been created and the EnableReceivers property is set to true.
<Update 2013-08-09>
The next step is to recycle the OWSTimer service (SharePoint Timer Service) on each server. This ensures that the new receivers are properly picked up by the timer jobs.
</Update 2013-08-09>
Waiting one day the usage reports were now showing data. (Note the below report was mocked up manually to show data as I did not have direct access to the customers’ reports, but this is consistent with what we had seen after the scripts were applied.)
Conclusion
This is a strange scenario of no data in the usage reports when there is data in the logging databases. I’ve run into it myself and with 2 customers, but when I tried to reproduce the scenario I couldn’t. If anyone is facing this issue hopefully this process of manually creating the usage definition receivers and waiting 24 hrs is a workaround. Let me know if you have seen this and if the workaround works for you. Curious to learn more on it.
-Frog Out
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#631636I just ran into this issue we had no recievers. Ran your script minutes ago and it updated the recievers, now I wait. I will post back if it fixed
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#631656Ryan, Thanks for trying out. I forgot one piece of information. After you add the receivers back you’ll also need to recycle the OWSTimer service on each server. I’ve updated the blog post to reflect this. If you don’t have data on the following day try that and see if that helps.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#631691Yes this did fix the issue I was having thank you!
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#631707Ryan, Glad to hear it helped.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#632311Thank you, this helped me a LOT!
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#632606I had been searching for this for months, thanks for the help!!!
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#633362My both event handlers are working fine and I restarted the timer job, still I got 0 count ( for Unique user and hits). but this was working fine two months backMy current report ( usage)================July – i have recordsAugust – I have recordsSep – 0Oct -0But for “Number of Queries” i have values….Kindly give me a solution for this….
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#633416Prasath, Check to see if your Usage and Health Data Collection service application and service application proxy are started. Also check your WSS_Logging database if it has data populated in the tables for page requests.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#634128HiMicrosoft.Office.Server.Search.Analytics.Internal.AnalyticsCustomRequestUsageReceiver doesnt seem to exist. I an unable to find any doco or reference it in visual studio. Am I missing something.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#634247HiThe usage stats seem to be 2 days apart. ine usage entry is for 6/12 and the other is 9/12 nothing inbetween. Can you help
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#634268Mayank, It could be that the timer job to collect the data for those 2 missing days did not run properly, the data was corrupted, or a number of other reasons. Hard to know without investigating further.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#634330Thanks. I notice that for the 12/12 and 13/12 the data was collected. although it is not consistent. Also some documents library have the report and some don’t. Can you suggest any troubleshooting steps I can take to resolve this issue?
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#635590Thank you so much! I’ve been plagued by this since day one and I couldn’t figure out why I had search analytics, but no usage! Both of my receivers were missing, but not any more.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#635599Thanks guys, you helped a lot.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#637277Many thanks for this Brian!!!
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#638295Brian, thanks for this INFO, but I have a question, does this apply both for Standard and Enterprise CALs? Im trying to use the ViewsRecent managed properties on a Search Results webpart without success, and I cannot see Usage Reports anywhere.Thanks a lot!
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#639526Brian, I ran your script to fix my development env. However it didn’t fix my uat env. All the analytic reports show zero count. What else I can do? (I have recycled OWSTimer)Not sure why Microsoft make their official feature so difficult to setup?
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#639527Brain, I want to add that there is no official solution to fix this problem. I install several SP2013 farm and all of them had no Receivers defined by default.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#642691I am facing this issue at the page level. As you know, you can click the Popularity Trends menu on each page to view usage data for that page. In my SharePoint deployment, I can see usage data for every page except one which is the Default.aspx page. When I queried the AnalyticsItemData table, it showed LastProcessingTime of Dec 15, 2014.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#642822Hi Brian, Thanks for your wonderful scripts. Unfortunately, which I ran the customer’s machine. On SharePoint 2013 app and front end servers. and ran timer job for all servers but even after 2 days no data was shown up. I tried other options such as: i. Microsoft SharePoint Foundation Usage Data and ii. Microsoft SharePoint Foundation Usage Data Processing. Both were enabled. I re-run the job schedules again. iii. C:Program FilesMicrosoft Office Servers15.0DataOffice ServerAEStore today’s and past folders were there. however, I did not verify the search service application and WSS_Logging database. Any other pointers that I could run the scripts so that usage report are available for the customer?Thank you.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#642823Hi Brian, The site analytics were working earlier. Recently, the customer reported this issue and I used your scripts.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#643692Hi Brian,We have two site collections in our environment. One is root site collection and another one is searchcenter site collection. Usage reports are showing data for root site collection but not for searchcenter site collections. However other reports like “number of queries” and “top queries by day” reports are showing data. I have checked logging database, it has data in it. All jobs are running fine and also we don’t see any errors in search crawl jobs. Also these receivers are enabled. Couldn’t see any errors in log files too.Can you please help with this issue.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#643939We are having this same problem in O365. I have opened a ticket with Premier support because I can’t run scripts like this in SPOnline
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#644196Hello,Thanks for the post,I have a standalone Sharepoint Server 2013, the receivers are defined, I did not run the script and I am still not showing up data from the last month, there rest of the previous months I have data.I can see the data on the SQL server.Can you help me? Regards
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#644287Diogo… Monday.. I will revisit this post and provide you with some info.. will that work? I have worked with Brian before and I am pretty familiar with Analytics in 2013..
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#644463We had the same problem on our farm and the script corrected it.Two ideas: – We used autospinstaller- I read this on Microsoft documentation ‘Only Search analytics is available to SharePoint Server 2013 Standard CAL customers. Usage analytics is not available.’
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#646328Many thanks for sharing this gem with us. It worked great on the first try and next day I was able to see the counts in the report.Much Appreciated!!
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#646809I have the same issue on my SP2013 farms, activity was working some time ago but after reverting the farms it displays 0, I have reviewed the receivers and both are configured in the same way as yours, DB is showing activity but report is displaying 0, do you have any idea of my problem?.Thanks in advance!! PS: Nice post BTW!
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#647264Most popular items is specific to site collection?last month i have fixed the issue for one site( Sub site) and Most popular items were showing as expected. After 2 weeks another user reported the issue for different issue and fixed the issue and now results were showing as expected. What is the permanent fix. Popularity trends is specific to site.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#647321Thanks it help me …..Resolve issue
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#647329Hello,Both of my event receivers are enabled. And my timerjob is also started. But yet it is showing me 0 data in usage reports. What must be the reason.
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#648437Hi,Even after execution of powershell and time service restart and after one day still getting output as 0. I checked the usage log report its running fine, only popularity trends is not working. Kindly suggest your viewpoint
LikeLike
Originally posted on: https://briantjackett.com/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx#649914tmer jobs are also running and receivers are also enabled.Still getting 0 results in Popularity trend reportCan someone please help
LikeLike
We only see usage data from the point when we applied this fix. I would have thought this should include all detail from when Usage&Health was enabled in the farm (ie; day 1)
LikeLike
This should have worked out of the box. Thank Brian. I gather since there was no reporting point specified in the configuration you would not be able to restore the old logs. They data probably exists but reposting will require some more research.
LikeLike
I haven’t found a way to restore old logs but also haven’t researched much. Part of this will depend on how old the missing data is and whether or not the source data exists in the logging database (default name WSS_Logging). There might be a way to force re-processing of data into the search analytics DBs but I haven’t checked before.
LikeLike
Hi Brian,
I having this issue for a specific site collection. I have several SharePoint sites from where I can get usage report successfully except from one specific SharePoint site.
This is in SharePoint 2016 farm.
Any idea how to fix this issue.
LikeLike
Bharat,
I’ve not seen an issue with a single site not showing usage reports. Can you confirm that the timer jobs for collecting usage logs are running and search service is properly configured?
LikeLike
Brian,
Thanks for your response. Yes the following timer jobs are configured correctly.
Microsoft SharePoint Foundation ‘Usage Data Import’ , Usage Data Maintenance , Usage Data Processing.
Also, search is working fine. **The site collection in our discussion** was not added in the content source.
I created a new content source and ran a ‘Full Crawl’ , Still the issue persist
Also, the below script to show the analytics information is not returning any information, where while running the
$searchApp = Get-SPEnterpriseSearchServiceApplication
$site = Get-SPSite “https://Sharepoint site”
$result = $searchApp.GetRollupAnalyticsItemData(1,[System.Guid]::Empty,$site.ID,[System.Guid]::Empty)
$result
same script for other sharepoint site returns the following information.
EventType : 1
SiteId :
ScopeId :
TenantId :
ItemId :
LastProcessingTime :
CurrentDate :
TotalHits :
TotalUniqueUsers :
LastProcessingHits :
LastProcessingUniqueUsers :
any idea…
LikeLike
Please read the below line as
same script for other sharepoint site returns NO information.
LikeLike
Hello Brian,
Thank you for your Great Article.
I was searching this article from many days and now i got it.
In our SP2013 environment(2 servers), we also receiving the 0 count on Popularity Trend report.
I have executed your complete script in the Application server and recycle the OWSTimer service (SharePoint Timer Service) on both the servers. Then waited for 1 day for Search Crawler completion time and then checked the Popularity Trend report which is showing some values rather than 0.
Thank you very much for your wonderful article who is facing the same issues on their SP servers.
LikeLiked by 1 person