Home » A-Z guides to set up and use Wizdom’s modules » Analytics » Configuring Wizdom Analytics with Azure
[printicon align="left"]

Configuring Wizdom Analytics with Azure

Final configuration is done from the Analytics module in the Wizdom application.

Analytics Data Import (requires Wizdom 6.16.0.7+)

By default, and especially on the free Application Insights tier, data is only persisted for 90 days. If data retention beyond 90 days is required, it is possible to configure any number of Application Insights Analytics queries for import into a SQL Database.

In order to query data from Application Insights at the free tier, a known user-account that has access to the Windows Azure management API has to be configured in the Wizdom Web Application settings. Two keys are required – ApplicationInsightsUsername and ApplicationInsightsPassword.

By default, data will be written to the same SQL database as Wizdom, but if a different database is desired, the connection string can be configured in the Connection strings section of the Wizdom web application settings. The connection string should be named ApplicationInsightsDataImport.
Final configuration is done from the Analytics module in the Wizdom application.
The query-designer has in-built autocomplete and documentation of the Analytics query language. When formulating the query, it is advised to restrict the dataset to a manageable size. The data import job will run every 15 minutes, and import new data. If for some reason the job did not run, data may be missed – because of this, it is recommended to fetch about a days worth of data each run. If this becomes unmanageable, decrease the size to at least 30 minutes worth.

In order to restrict that data returned, pipe the result into the “where” keyword, and filter on the “timestamp” column: | where timestamp > ago(1d).

When the desired data has been attained, please project the columns into a flattened table layout, and always include the columns itemId and timestamp: | project itemId, timestamp. Please note that itemId and timestamp are case sensitive.

When selecting columns, these can be renamed like this: account = customDimensions.user_loginname. When importing this query, a column named account will be created in the destination table, containing the account names of visitors.

The finished query could look like this:

pageViews | where timestamp > ago(1d) | project itemId, timestamp, account = customDimensions.user_loginname

Subscription ID – this is found in the Essentials pane of the Application Insights instance

  • Resource Group – this is also found in the Essentials pane of the Application Insights instance
  • Application Insights instance name – this is the title of the Application Insights instance
Any number of queries can be added to the job – each will import to the desired destination table. In order to easily create Analytics queries, open the Application Insights Analytics tool, by clicking the Analytics button from the Application Insights instance in the Windows Azure management portal:
Doubleclick any of the tables in Application Insights, in order to start a new query
The query-designer has in-built autocomplete and documentation of the Analytics query language. When formulating the query, it is advised to restrict the dataset to a manageable size. The data import job will run every 15 minutes, and import new data. If for some reason the job did not run, data may be missed – because of this, it is recommended to fetch about a days worth of data each run. If this becomes unmanageable, decrease the size to at least 30 minutes worth.

In order to restrict that data returned, pipe the result into the “where” keyword, and filter on the “timestamp” column: | where timestamp > ago(1d).

When the desired data has been attained, please project the columns into a flattened table layout, and always include the columns itemId and timestamp: | project itemId, timestamp. Please note that itemId and timestamp are case sensitive.

When selecting columns, these can be renamed like this: account = customDimensions.user_loginname. When importing this query, a column named account will be created in the destination table, containing the account names of visitors.

The finished query could look like this:

pageViews | where timestamp > ago(1d) | project itemId, timestamp, account = customDimensions.user_loginname

Deploying Azure Application Insights

  1. Login to https://portal.azure.com
  2. Click the Web Application = <wizdom resource group name>
  3. Click the Web Application = <wizdom web app name>
  4. In the Monitoring section click Application Insights
  5. Click Create a new resource and name it = <wizdom application insights instance name>
  6. Click OK to create the Application Insights service
  7. Click the Orange message at the top to start the service
  8. Click VIEW MORE IN APPLICATION INSIGHTS
  9. Copy the Instrumentation Key and note it down
  10. Back in the <wizdom web app name> in the Settings section click Application Settings
  11. In the App settings section, create a new key (or rename the one automatically created by the App Insight installation) with the following information:
    • Key = <ApplicationInsightsInstrumentationKey>
    • Value = <The Instrumentation Key from step 9>
  12. Back in the <wizdom web app name> click Overview
  13. Restart the <wizdom web app name> web app

Wizdom configuration

  1. If SharePoint online: Login to https://CUSTOMER.sharepoint.com/sites/wizdomportal  using <SPOadminAccount>
  2. If SharePoint 2013/2016 on-prem: Login to https://CUSTOMER
  3. Go to Site Content and click the Wizdom add-in
  4. Click Modules and the Analytics
  5. Enable Enable analytics and statistics collection
6. Click Save configuration

Configuring data in Wizdom database

First step:

  1. Login to https://portal.azure.com using <AzureAdminAccount>
  2. Click the Wizdom Resource group = <wizdom resource group name>
  3. Click the Application Insights application = <wizdom application insights instance name>
  4. Click Access Control (IAM)
  5. Add the <Service account (App insights reader)> as reader
  6. Click the Wizdom Resource group = <wizdom resource group name>
  7. Click the Web Application = <wizdom web app name>
  8. In the Settings section click Application Settings
  9. In the App settings section, create new keys with the following information:
    • Key = ApplicationInsightsUsername
    • Value = <Service account (App insights reader)>
    • Key = ApplicationInsightsPassword
    • Value = <Service acc. password (App insights reader)>
  10. Click Save
  11. Back in the <wizdom web app name> click Overview
  12. Restart the <wizdom web app name> web app
Second step:

  1. Login to https://CUSTOMER.sharepoint.com/sites/wizdomportal  using <SPOadminAccount>
  2. Go to Site Content and click the Wizdom add-in
  3. Click Modules and then Analytics
  4. Configure the following settings:
    • Subscription ID = < Wizdom Azure subscription ID>
    • Resource Group =  <Wizdom resource group name>
    • Application Insights Instance Name = <wizdom application insights instance name>
  5. Click Save configuration
  6. Click Admin and then Timerjobs
  7. Click Run now on ApplicationInsightsDataImport
  8. Optional: Using SQL Server Management Studio connect to the Wizdom database in Azure and confirm that the table dbo.AI_PageViews has been created