Configure Analytics for SmartHub with SharePoint 2013/16/19/SPSE

 

Overview

To configure Analytics for SmartHub you perform the following:

  1. Install all necessary third-party applications
  2. Configure the Analytics Component
  3. Configure and access the Reporting Site

  4. Verify the Analytics Components

Initialize Kibana

Use the following steps to initialize Kibana v7.x:

  1. Go to your Kibana Dev Tools.
    1. URL (or similar): http://localhost:5601/app/dev_tools#/console?_g=()
  2. Enter this command and run it:
    PUT test/_doc/1
    {}


  3. Open Stack Management → Index Patterns:


    1. URL: http://localhost:5601/app/management/kibana/indexPatterns
  4. Create an index pattern based on index:
    1. Click "Create Index pattern."
    2. Write "test" in "index pattern" text box. NOTE: The field is case-sensitive!
    3. Click the Next step button.
    4. Click "Create index pattern"

After you totally complete the SmartHub Analytics installation, you can delete the index-pattern and index.

  1. Go to Kibana address → Stack Management → Index Pattern.
    1. Delete the "test" index pattern.
  2. Go to Kibana address → Dev Tools.
  3. Enter into the console "DELETE test" to delete index.

Configure the Analytics Component

To configure Analytics, use the following steps:

  1. Navigate to the SmartHub Administration page by going to http(s)://[SmartHub-web-app-url]/_admin
  2. Go to the Additional settings page and click on Storage Settings > Edit.
  3. Complete all the fields shown.
    Some information is pre-populated.
    See the graphic below.
    1. Elastic Server Address: URL, including port number, of your Elasticsearch server
    2. Kibana Server Address: URL, including port number, of your Kibana server. For example: http://myhost:5601
    3. Bot Index Name: Name of your bot index. Default name is bot-index.
    4. Delayed Answers Index Name: Name of your delayed answers index.
    5. Analytics Index Name. Save the changes.
    6. Authentication mode:
      1. Basic:
        1. Account: Necessary only for Elastic users. Username of the account used to access your Elasticsearch server.
        2. Password: Necessary only for Elastic password. Password of the account used to access your Elasticsearch server.
      2. Token Based:
        1. Azure App ID: Enter App IDs from Azure App created for Elastic Authentication
        2. Azure Secret Key: Enter Secret Key from Azure App created for Elastic Authentication
        3. Azure Scope: Enter Azure Scope from Azure App created for Elastic Authentication

          Optional

          The Kibana Server address (configured at step 3-b. above) is used when displaying reports to end users.

          • Typically, you provide your Kibana Service Address here, however that address may not be accessible to end users. 
          • If the Kibana address domain or HTTP settings are different from SmartHub, you may have difficulty displaying the reports in the browser.

          As a solution, you may wish to configure Kibana behind a reverse proxy; to do so, see the FAQ "How Do I Configure the Kibana URL for Reporting Behind a Reverse Proxy?"

          Optional

          When using Kibana and Elastic Cloud, you have to add the following setting to the file kibana.yml xpack.security.sameSiteCookies: "None"

          Take a look at Embedded content authentication for more information. 

  4. Scroll down and click Save to save your changes.

Advanced Settings

  1. Click "Analytics Settings" from the left-side navigation list.
  2. The Analytics Configuration page opens.

Recommended Results Configuration JSON

  • You can leave this field as it is (default).

  • This field can be customized at any time.

Query Suggestion Settings Configuration JSON

  • You can leave this field as it is (default).

  • This field can be customized at any time.

Verify Kibana Configuration

  1. Kibana Configuration Status
    1. When you access the page, you will see a message which describes the Kibana configuration status: 
      • "Kibana is not configured" → This means that the Kibana objects are not imported, and the mappings of the Analytics index are not created.
        • The configuration of Kibana is performed upon clicking the "Save Configuration" button.
      • "Kibana already configured" → This means that the Kibana objects have already been imported and the Analytics Index mappings have already been created.

How to Access the Reporting Site

To access the Reporting Site, use the following steps:

  1. Navigate to the SmartHub Administration page by going to the SmartHub Admin web User interface (UI) or enter the URL in the format: http(s)://[web-app-url]/_admin
  2. Click Reporting Site as shown in the graphic here:


  3. The SmartHub Analytics reporting site appears:

Analytics Settings

Setting name Default value Description
Enabled "true"
  • "true" - Analytics is enabled.

  • "false" - Analytics is disabled.

PAXModules PAXModules "PAX_PortalModule,PAX_SearchModule,PAX_UserProfileModule, PAX_VisualRefinersModule,PAX_SmartPreviewsModule,PAX_Ratings, PAX_ChatBotModule,PAX_SmartAutomationsModule" The modules for which actions are recorded in the analytics index.
customProperties ""
  • Custom document metadata that should be recorded for any user action related to a document.

  • Example: OpenItem, PreviewDocument, DocumentRated etc.

showTrackingBehaviorControl "true"
  • "true" - Analytics tracking section is displayed in the Personalization menu.

  • "false" - Analytics tracking section is hidden in the Personalization menu.

enableGeolocationTracking "true"
  • "true" - The geolocation tracking is enabled.

  • "false" - The geolocation tracking is disabled.

artifactPushInterval 60

The number of seconds after which the actions will be sent to the server to be recorded in the analytics index.

Note: In order for actions to be recorded in real time set this setting to 0 seconds.
visitsDuration 30 The number of minutes after which a visit ends.
geolocationTrackingMessage "We would like to know your location in order to improve your search experience.".toLocaleString() The message displayed for geolocation tracking.
trackingBehaviorPropertyName "BAISmartHubAnalyticsTrackingBehavior" The property name for tracking behavior.
defaultTrackingBehavior "0"
  • 0 - Track

  • 1 - Do not track

  • 2 - Track but hide identity

trackingControlFile "client/pax-tracking-behavior-control"

The path to the trackingControl JavaScript file.

Note: Must have the format used by require.js
recommendedResultsControl showRecommendedResultsDropdown false
  • true - The dropdown list for recommended results is displayed

  • false - The dropdown list for recommended results is hidden

enableRecommendedResultsControl true
  • true - The recommended results control is enabled

  • false - The recommended results control is disabled

title "Filter results by".toLocaleString() The label of the recommended results dropdown list
messageNotFoundRecommededResults "Could not find any results for option: ".toLocaleString() The message displayed when no results are found for recommended results
items
Copy
{
    "Default": {
        value: "0",
        label: "Default".toLocaleString()
    },
    "RecentlyViewed": {
        value: "1",
        label: "Recently viewed".toLocaleString(),
        lastDays: "5",
        maxResults: "100"
    },
    "MostUsedByMe": {
        value: "2",
        label: "Most used by me".toLocaleString(),
        lastDays: "5",
        maxResults: "100"
    },
    "WhatOthersAreViewing": {
        value: "3",
        label: "What others are viewing".toLocaleString(),
        lastDays: "5",
        maxResults: "100"
    },
    "NewResults": {
        value: "4",
        label: "New results".toLocaleString(),
        lastDays: "5",
        maxResults: "100"
    },
    "CuratedResults": {
        value: "5",
        label: "Curated results".toLocaleString(),
        lastDays: "5",
        maxResults: "100"
        "SmartAnalyticsIndex.[AccountName]": "AdditionalProperty.[AccountName]"
    }
}
  • The list of drop-down options for recommended results

  • The "value" parameter for each item must correspond with an option of Recommended Results Configuration Json from the Analytics Settings section in the SmartHub administration site

parentSelector ".coveo-results-header" The JQuery selector for parent element(s) where to inject the control.
UserProfileMappings
Copy
{
    "PreferredName": "User".toLocaleString(),
    "AccountName": "AccountName".toLocaleString(),
    "Department": "Department".toLocaleString(),
    "Office": "Office".toLocaleString(),
    "SPS-JobTitle": "JobTitle".toLocaleString(),
    "Title": "Title".toLocaleString(),
    "SPS-Location": "UserLocation".toLocaleString(),
    "SPS-Birthday": "Birthday".toLocaleString(),
    "SPS-TimeZone": "TimeZone".toLocaleString(),
    "Manager": "Manager".toLocaleString(),
    "SPS-Skills": "Skills".toLocaleString(),
    "SPS-HireDate": "HireDate".toLocaleString(),
    "YearsWithCompany": "YearsWithCompany".toLocaleString()
}
  • The mappings of the properties for user profile.

  • The original user profile provider properties are on the left and the desired labels on the right.

enableCaseSensitivity "false"
  • "true" - Case sensitivity is enabled for user queries.

  • "false" - Case sensitivity is disabled for user queries.

logLevel "WARN"
  • The browser console log level for the Analytics module.

  • Possible values: INFO, DEBUG, WARN, ERROR, OFF.

 

How to Modify the Analytics Settings

To modify the Analytics settings, you need to access two files listed below.

  1. Your Index or Results page custom settings file (.js):
    1. Located in <SmartHub_root_folder>/CustomerCustomization/settings 
    2. If you want analytics to track data on your Index page, use your custom Index settings file: IndexCopySettingsCustomSettings.js.
    3. If you want analytics to track data on your (search) Results page, use your custom Results settings file: ResultsCopyCustomSettings.js. This is the natural choice.
    4. If you have a separate custom settings file see How to Customize Your SmartHub User Interface.
  2. Analytics settings: The file DefaultModuleSettings.js contains all SmartHub analytics properties, which control how analytics behaves on your web page.
    • The DefaultModuleSettings.js file is stored in: <SmartHub_root_folder>/modules/SmartHubResourceLoader.

Example: Disable Geographical Location Tracking

In the following procedure you disable Geographical location tracking.

To do this, you copy the Geographical location tracking code from DefaultModuleSettings.js file into your custom settings file and change the value from true to false to disable the function.

  1. Open the file DefaultModuleSettings.js, shown below.


  2. Copy the setting enableGeolocationTracking: "true".
    Note that you can copy and modify any setting you desire.
  3. Open your custom Results settings file and paste the setting under the SH.AnalyticsSettings.CustomSettings block.
    1. Change the value to "false."
    2. In the example below, the custom setting is added to disable the Geological Tracking option.


  4. Save the file.
  5. Ensure your custom setting file is referenced by the custom Index or Results HTML pages where you want analytics to track your data.
    1. In the graphic below, the custom Index page IndexCopy.html references the custom settings file IndexCopyCustomSettings.js.
      For more information, see How to Instruct SmartHub to Load your Custom Settings.