Configure Web Analytics service application (SharePoint Server 2010)
Applies to: SharePoint Server 2010
This article describes how to configure the Web Analytics service application in Microsoft SharePoint Server 2010. Once the Web Analytics service application is configured, you are able to collect, report, and analyze the usage and effectiveness of SharePoint Server 2010 sites. For different ways to schedule and display these reports, you can use Web Analytics Workflow and Web Analytics Web Parts, respectively. By using these features, you are able to understand what users are doing and can better understand what information they want from a site.
Before you configure the SharePoint Web Analytics service application, we recommend that you read Capacity requirements for the Web Analytics Shared Service in SharePoint Server 2010
In this article:
About Web Analytics
Configure the Web Analytics service application by using the Farm Configuration Wizard
Configure Web Analytics service application by using Central Administration
Configure the Web Analytics service application by using Windows PowerShell
Create and configure the View Web Analytics Data permission
Add the Web Analytics workflow
Add the Web Analytics Web Part
About Web Analytics
The Web Analytics service application is automatically configured as part of the Basic installation of Microsoft SharePoint Server 2010.
Advanced installation of SharePoint Server 2010 requires separate configuration of the Web Analytics service application. You can configure the Web Analytics service application after installation of SharePoint Server 2010 by using one of the following tools:
Farm Configuration Wizard
Central Administration
Windows PowerShell
The default configuration for the Web Analytics service application consists of:
One Web Analytics service application.
One Web Analytics Reporting database and one Web Analytics Staging database. The databases must be associated with the service application. For additional information about reporting and staging databases, see Database types and descriptions (SharePoint Server 2010).
Note
There is no support for configuring the Web Analytics Reporting and Web Analytics Staging databases to use SQL authentication.
One Web Analytics Service application proxy associated with the default proxy group of the server farm.
Configure the Web Analytics service application by using the Farm Configuration Wizard
After setup is finished, the opening page of the Farm Configuration Wizard opens automatically. The administrator can choose to run the wizard immediately or wait until later. In the Farm Configuration Wizard, all service applications that are not currently configured are selected for configuration by default. If you do not want to configure the Web Analytics service application until later, you can clear the check box for the service and run the Farm Configuration Wizard later.
Note
Until you configure the Web Analytics service application, you will not be able to run or create reports that use the Web Analytics service application.
If the Web Analytics service application check box is unavailable, it has already been configured. After initial configuration, you can only configure the Web Analytics service application by using the Central Administration Web site or Windows PowerShell.
To configure the Web Analytics service application by using the Farm Configuration Wizard
On the Central Administration Web site, click Configuration Wizards.
On the Configuration Wizards page, click Launch the Farm Configuration Wizard.
On the first page of the Farm Configuration Wizard, click Start the Wizard.
On the services configuration page, in the Services section, click to select the Web Analytics Service Application check box.
Note
If the Web Analytics Service Application check box is unavailable, the Web Analytics service application is already configured. To make changes to the configuration you must use Windows PowerShell or the Central Administration Web site.
Click Next.
Complete any other configuration steps for the server farm.
On the final page of the Farm Configuration Wizard, click Finish.
Configure Web Analytics service application by using Central Administration
You can use Central Administration to configure the Web Analytics service application. The following five steps are required to configure the Web Analytics service application:
Create the Web Analytics service application.
Associate one or more Web applications with a Web Analytics service application.
Verify that the Web Analytics Web Service and Web Analytics Data Processing Service are started.
Verify that usage logging is enabled for the desired event. For information about events and usage logging, see Configure usage and health data collection (SharePoint Server 2010).
Verify that the State Service Application and State Service Application Proxy are started.
To create the Web Analytics service application by using Central Administration
Verify that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group.
In Central Administration, on the Home page, click Application Management.
On the Application Management page, in the Service Applications section, click Manage service applications.
On the ribbon, click New, and then click Web Analytics Service Application.
For the Application Pool parameter, specify an existing application pool name or create a new application pool name.
For the Database Server parameter, specify a database server name for the service application.
For the Staging Database Name parameter, type the name of the staging database.
For the Reporting Database Name parameter, type the name of the reporting database.
Click OK.
To associate a Web application with a Web Analytics Service application by using Central Administration
Verify that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group.
In Central Administration, on the Home page, click Application Management.
On the Application Management page, in the Service Applications section, click Configure service application associations.
If the Web Analytics Service application proxy is not included in the list of application proxies, click the appropriate Web application. Next, in the Configure Service Applications Associations dialog box, select the Web Analytics Service Application Proxy check box to associate it with the Web application.
To verify that the Web Analytics Data Processing Service and the Web Analytics Web Service are started by using Central Administration
Verify the following that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group and that procedure is performed on the application server.
In Central Administration, click System Settings.
On the System Settings page, in the Servers section, click Manage services on server.
From the Action column, click Start for the Web Analytics Data Processing Service and the Web Analytics Web Service.
To verify that usage logging is enabled for desired event by using Central Administration
Verify that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group.
In Central Administration, on the Home page, click Monitoring.
On Monitoring page, in the Reporting section, click Configure usage and health data collection.
On the Event Selection section, click all check boxes to select them, and then click OK.
For additional information about usage logging and Web analytics service, see "Capacity Requirements for Web Analytics Shared Service in SharePoint Server 2010", accessible from Performance and capacity test results and recommendations (SharePoint Server 2010).
To verify that the State Service application is started by using Central Administration
Verify that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group.
In Central Administration, click Application Management.
On Application Management page, in the Service Applications section, click Manage service applications.
In the list of service applications, verify that State Service Application and State Service Application Proxy are set to Started. If the State Service Application or State Service Application Proxy are not started, see Manage the State Service (SharePoint Server 2010).
Configure the Web Analytics service application by using Windows PowerShell
To configure the Web Analytics service application by using Windows PowerShell
Verify that you meet the following minimum requirements:
See Add-SPShellAdmin.
You must read about_Execution_Policies (https://go.microsoft.com/fwlink/p/?LinkId=193050).
Copy the following code and paste it into a text editor, such as Notepad.
Note
To use a specific database name with this script, the database name must be created before the script is run. For information about how to use DBA-created databases, see Deploy by using DBA-created databases (SharePoint Server 2010).
Add-pssnapin Microsoft.SharePoint.PowerShell #Get Central Admin server $CentralAdminInstance = Get-SPServiceInstance | ? { $_.TypeName -eq "Central administration" } | ? {$_.Status -eq "Online"} $CentralAdminServer = $CentralAdminInstance.Server.Address #Get default SQL server $configDB = Get-SPDatabase | ? { $_.Type -eq "Configuration Database" } $DatabaseServer = $configDB.NormalizedDataSource #Create Analytics Web Application write-host "Creating web analytics service application" #Create app pool #Get Analytics Windows Service instance $serviceInstance = Get-SPServiceInstance | where-object {$_.Name -eq "WebAnalyticsServiceInstance"} | where-object {$_.Server.Address -eq $CentralAdminServer} $windowsservice = $serviceInstance.Service $serviceAccount = Get-SPManagedAccount -service $windowsservice $ServiceApplicationName = "AnalyticsServiceApplication1" $StagerDatabase = $ServiceApplicationName + "Stager" $WarehouseDatabase = $ServiceApplicationName + "Warehouse" $StagerSubscription = "<StagingDatabases><StagingDatabase ServerName='$DatabaseServer' DatabaseName='$StagerDatabase'/></StagingDatabases>" $WarehouseSubscription = "<ReportingDatabases><ReportingDatabase ServerName='$DatabaseServer' DatabaseName='$WarehouseDatabase'/></ReportingDatabases>" $ExistingServiceApp = Get-SPServiceApplication | where-object {$_.Name -eq $ServiceApplicationName} if ($ExistingServiceApp -ne $null) { Remove-SPServiceApplication $ExistingServiceApp -Confirm:$false } $ExistingServiceAppProxy = Get-SPServiceApplicationProxy | where-object {$_.Name -eq $ServiceApplicationName} if ($ExistingServiceAppProxy -ne $null) { Remove-SPServiceApplicationProxy $ExistingServiceAppProxy -Confirm:$false } #Check if application pool already exist, if so update it $ApplicationPool = Get-SPServiceApplicationPool | where {$_.Name -eq $ServiceApplicationName} if ($ApplicationPool -ne $null) { Set-SPServiceApplicationPool $ApplicationPool -Account $serviceAccount } else { #Creating app pool for service app $ApplicationPool = New-SPServiceApplicationPool -Name $ServiceApplicationName -Account $serviceAccount } $ServiceApplication = New-SPWebAnalyticsServiceApplication -Name $ServiceApplicationName -ReportingDataRetention 20 -SamplingRate 100 -ListOfReportingDatabases $WarehouseSubscription -ListOfStagingDatabases $StagerSubscription -ApplicationPool $ApplicationPool #Create Web Analytics Service Application Proxy write-host "Creating Web Analytics Service Application Proxy" New-SPWebAnalyticsServiceApplicationProxy -Name $ServiceApplicationName -ServiceApplication $ServiceApplication.Name #Start Analytics service instances write-host "Starting Analytics Service instances ..." $AnalyticsDataProcessingInstance = Get-SPServiceInstance | where-object {$_.Name -eq "WebAnalyticsServiceInstance"} | where-object {$_.Server.Address -eq $CentralAdminServer $AnalyticsWebServiceInstance = Get-SPServiceInstance | where-object {$_.TypeName -eq "Web Analytics Web Service"} | where-object {$_.Server.Address -eq $CentralAdminServer} Start-SPServiceInstance $AnalyticsDataProcessingInstance Start-SPServiceInstance $AnalyticsWebServiceInstance #Check to see if the State Service Application is available $state = Get-SPStateServiceApplication $stateName = "Default State Service Application" if($state -eq $null) { Write-Host "Creating the State Service Application" -foregroundcolor yellow $state = New-SPStateServiceApplication -Name $stateName Write-Host "Creating the State Service Application Proxy" -foregroundcolor yellow $state | New-SPStateServiceApplicationProxy -Name $stateName } $state = Get-SPServiceApplication | where {($_.name) -eq $stateName} if($state -ne $null) { Write-Host "Service application created" -ForegroundColor Yellow } write-host "Done."
Save the file, naming it
WebAnalytics.ps1
.Note
You can use a different file name, but you must save the file as an ANSI-encoded text file whose extension is .ps1.
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
Change to the directory where you saved the file.
At the Windows PowerShell command prompt, type the following command:
./WebAnalytics.ps1
Create and configure the View Web Analytics Data permission
After the Web Analytics service application is configured, the View Web Analytics Data permission needs to be created for users that are not a site collection administrator or site owner. This is the minimum required permission needed to view Web Analytics reports. End users who need to access a Web Analytics report must have this permission assigned to them.
To create the View Web Analytics Data permission for a site or site collection
Verify that the user account that is performing this procedure is that of a site collection administrator or a site owner.
From a site or site collection, click Site Permissions from the Site Actions menu.
On Site Permissions page, on the Edit tab, in the Manage group, click Permission Levels.
Click Add a Permission Level.
In the Name field, type View Web Analytics Data.
In the Permissions section, under the List Permissions, select the View Application Pages check box.
In the Permissions section, under the Site Permissions, select the View Web Analytics Data and Enumerate Permissions check boxes.
Click Create.
To configure the View Web Analytics Data permission for a site or site collection
Verify that the user account that is performing this procedure is that of a site collection administrator or a site owner.
From a site or site collection, click Site Permissions from the Site Actions menu.
On the Site Permissions page, on the Edit tab, in the Grant group, click Grant Permissions.
In the Users/Groups box, add the users that will be granted the View Web Analytics Data permission.
In the Grant Permissions section, click Grant users permission directly, and then select the View Web Analytics Data check box.
Click OK.
Add the Web Analytics workflow
After the Web Analytics service application is configured, you can schedule a workflow to run a Web Analytics report or a Web Analytics alert depending on the criterion that is met. For additional information about Web Analytics workflow, see Reporting and usage analysis overview (SharePoint Server 2010).
To create the Web Analytics report for a site
Verify that the user account that is performing this procedure is that of a site owner or site collection administrator.
From the root level of a site, click Site Settings from the Site Actions menu.
On Site Settings page, click Workflow settings under the Site Administration section.
Click Add a workflow.
In the Select a workflow template field, choose either an alert or report workflow.
In the Name field, type the name of the workflow.
In the Task list field, select the appropriate task list that will be used with this workflow. If none is available, click New task list.
In the History list field, select the appropriate history list to be used with this workflow. If none is available, click Workflow History (new).
In the Start Options field, select the appropriate permission level to start the workflow. By default, the workflow is manually started by an authenticated user.
In the Recipients field, type the name of the users who should receive the report.
In the Message field, type a message to be included in the e-mail message that is sent to the recipients.
In the Frequency field, select the frequency for this workflow. The default value is daily.
In the Start Date field, select the date to start the workflow. The default value is Today.
In the End Date field, select the date to end the workflow. The default value is Never.
In the Site Scope field, specify the scope of this workflow. The default value is This Site Collection.
In the Web Analytics Reports field, select the reports to include in the workflow.
Click Finish.
To create the Web Analytics alert workflow for a site collection
Verify that the user account that is performing this procedure is that a site owner or site collection administrator.
From the root level of a site collection, click Site Settings from the Site Actions menu.
On Site Settings page, click Workflow settings under the Site Administration section.
Click Add a workflow.
In the Select a workflow template field, choose either an alert workflow.
In the Name field, type the name of the workflow.
In the Task list field, select the appropriate task list that will be used with this workflow. If none is available, click New task list.
In the History list field, select the appropriate history list to be used with this workflow. If none is available, click Workflow History (new).
In the Start Options field, select the appropriate permission level to start the workflow. By default, the workflow is manually started by an authenticated user.
Click Next.
In the Recipients field, type the name of the users who should receive the report.
In the Message field, type a message to be included in the e-mail message that is sent to the recipients.
In the Site Scope field, specify the scope of this workflow. The default value is This Site Collection.
In the Condition(s) field, specify data condition(s) that will cause the workflow to send an e-mail.
Click Finish.
Add the Web Analytics Web Part
After the Web Analytics service application is configured, a site administrator or site owner can add a Web Part to a site to quickly view specific reports. For additional information about Web Analytics Web Part, see Reporting and usage analysis overview (SharePoint Server 2010).
To create the Web Analytics Web Part for a site collection
Verify that the user account that is performing this procedure is that of a site owner or site collection administrator.
From the root level of a site collection, click the Page tab.
From the Edit group on the ribbon, click Edit .
Under Editing Tools, click the Insert tab.
From the Web Parts group, click Web Part.
From the Categories column, click Content Rollup.
From the Web Parts column, click Web Analytics Web Part, and then click Add.
By default, the Most Viewed Content report will be displayed. To change the type of report to be displayed in the Web Part, you must edit the Web Part and change its properties.
See Also
Concepts
Workflow administration (SharePoint Server 2010)