Integrating a Coveo Lightning Insight Panel

Pro and Enterprise editions only

Coveo for Salesforce 3 (May 2018)

The Lightning Insight Panel is a search interface meant to be included in the sidebar of your Lightning Service Console and that suggests contextually relevant information to your agents. This panel is typically used to propose your support agents relevant solutions alongside their cases.

It is the Lightning Experience equivalent of the Coveo Classic Insight Panel (see Integrating a Coveo Classic Insight Panel).

Typically, you want the Lightning Insight Panel to be accompanied by the Coveo Attached Results, as both components rely on each other.

This article shows the recommended way of integrating the Coveo Lightning Insight Panel and the Coveo Attached Results in your Lightning Service Console.

Prerequisites

  1. Ensure you have created a Lightning Service Console (see Lightning Service Console).
  2. Ensure you have set up a domain name for your organization (see Set Up a My Domain Name).
  3. Ensure you have installed and configured the Coveo for Salesforce V3 package (see Installing the Coveo for Salesforce Application).

Step 1 - Add the Coveo Lightning Insight Panel Component in Salesforce

When adding a Lightning Insight Panel component, you should always put it at the top right of the page to make it visible. It is recommended to place it beside your case information or your Live Agent chat session.

Adding a Lightning Insight Panel to a Case Page

  1. In Salesforce, access your Lightning Service Console, and open any of your cases.
  2. At the top right of the page, click the cog icon (), and select Edit Page.
  3. In the Lightning App Builder, drag the Record Detail from the right side of the page to the left side of the page.
  4. Drag and drop the Coveo Insight Panel component to the right side panel.

  5. Drag and drop the Coveo Attached Results component where you want it.

    It is recommended to place the Coveo Insight Panel and the Coveo Attached Results components where we can see both of them at the same time.

  6. At the top right, click Save.
  7. If not already done, activate the new page.
    1. Click Assign as Org Default.

      You can make these changes available as default, or edit the assignment rules to only activate this page for specific users or profiles.

    2. Once you are done with the assignment rules, click the Save button.

  8. Now that your page is saved, at the top right of the page, select Back.
  9. Select either the Coveo Insight Panel or Coveo Attached Results component, and select the Set Up a Search Page button.

  10. Choose the tabs you want to have in your panel, and select Create Page. You can always change the tabs later.
  11. Repeat these steps for the other Coveo component in your right side panel.

Since you do not need the case you are currently working on to appear in your results, you should filter it out from the results by following these steps:

  1. On the Case page, click Setup and select Edit Page.
  2. After clicking anywhere on the Insight Panel, in the Record Fields, add the Case_CaseNumber field.
  3. In your Coveo Cloud administration console, in the Filters tab, click Add Rule.
    1. In the Add a Filter Rule page, under Query parameter, select cq (constant query)
    2. Under Query Filter, add the following code:
      NOT @sfcasenumber=$context.Case_CaseNumber
      
    3. Click Add Rule.

Adding a Lightning Insight Panel to a Live Agent Chat Page

  1. Ensure you have enabled Live Agent in your Salesforce organization.
  2. In Salesforce, access your Lightning Service Console, and open any of your Chat sessions.
  3. At the top right of the page, click the cog icon (), and select Edit Page.
  4. In the Lightning App Builder, on the Live Chat Transcript Record Page, drag and drop the Coveo Insight Panel component to the right side panel.
  5. At the top right, click Save.
  6. If not already done, activate the new page.
    1. Click Assign as Org Default.

      You can make these changes available as default, or edit the assignment rules to only activate this page for specific users or profiles.

    2. Once you are done with the assignment rules, click the Save button.

  7. Now that your page is saved, in the top right of the page, select Back.
  8. In the Insight Panel, select the Set Up a Search Page button.
  9. Choose the tabs you want to have in your panel, and select Create Page. You can always change the tabs later.

You should now have a functional Coveo Lightning Insight Panel.

Step 2 - Configure Your Lightning Insight Panel Component in Coveo Cloud

  1. In your Coveo Cloud Administration Console (see Logging in to Coveo Cloud V2), select the query pipeline used by your Insight Panel and access the query pipeline Query Parameters (see Adding and Managing Query Pipeline Query Parameters).

    By default, your Insight Panel uses the Default pipeline .

  2. Note the name of your query pipeline, as you will need it later.

  3. In the Machine Learning tab, add an Automatic Relevance Tuning (ART) model with the Enable Intelligent Term Detection (ITD) option selected (see Activating Machine Learning Intelligent Term Detection (ITD) in Salesforce).

  4. In the Query Parameters tab, add a rule overriding the large query (lq) parameter value:

    1. Click Add Rule, and then select Query Parameters With Code.
      1. In the Add a Rule With Code dialog, in the form editor box, enter the following rule:
        • For the Case Page:

          override query lq:"<@+ $context.Case_Subject $context.Case_Description +@>"
          
        • For the Live Agent Chat Page:

          override query lq:"<@+ $context.LiveAgent_AllVisitorMessages +@>"
          

          The context can either be: LiveAgent_LastVisitorMessage, LiveAgent_LastAgentMessage, LiveAgent_AllVisitorMessages, or LiveAgent_AllAgentMessages.

          The LiveAgent_AllVisitorMessages context value provides all the customers messages and context from which Coveo Machine Learning can identify relevant keywords. With LiveAgent_LastVisitorMessage, the previous messages context values are excluded. LiveAgent_LastAgentMessage and LiveAgent_AllAgentMessages context values only show agent results.

      2. Click Add Rule.
    2. In the Action bar, click More, and then select Select condition.

    3. Add a Condition that is applied when an empty query is performed (see Create a Condition).

      You can use the same query pipeline for both of your Case and Live Agent chat pages, but you have to enter different SearchHub names, typically AgentCase and AgentChat.

      Ensure that, when adding the overriding rules in your Query Parameters for each Insight Panel, you create a condition Search hub is [SearchHub name] for each Search hub.

  5. Your Query Parameters tab should now look like this:

Depending on your use case, you must add the custom dimensions to make the search and click events metadata available in your usage analytics reports (see Adding and Managing Dimensions on Custom Metadata).

  • For the Case Page: add context_case_description and context_case_subject dimensions.
  • For the Live Agent Chat Page: add context_liveagent_allvisitormessages, context_liveagent_allagentmessages, context_liveagent_lastvisitormessage, or context_liveagent_lastagentmessage dimensions.

Adding the Create Article button

In your Lightning Insight Panel, you can add a button to create a knowledge article directly from a case.

This button only works with Lightning Knowledge (see Set Up and Configure Lightning Knowledge).

  1. Access the Lightning Insight Panel.
  2. Access the Edit mode of the Lightning Insight Panel.
  3. Access the Code View tab.
  4. Insert the following code anywhere you want:

    <div class="CoveoCreateArticle"></div>
    

Adding the UserActions Component

Coveo for Salesforce 3.38 (August 2019)

To enable this feature, you must contact us.

The UserActions component allows your agents to analyze all the user’s recent activities before they created the case, such as User Query, Clicked Document, or Page View. The panel also displays activities from the agent who created the case.

  1. Access the Lightning Insight Panel.
  2. Access the Edit mode of the Lightning Insight Panel.
  3. Access the Code View tab.
  4. Insert the following code just before the <div class="coveo-tab-section"> element:

    <div class="CoveoUserActions"></div>
    
    • Ensure you do not insert the code in the template or in the coveo-main-section.
    • The Start Date is displayed in the language of your browser.

Adding the Viewed by Customer Component

Coveo for Salesforce 3.39 (August 2019)

The ViewedByCustomer Component allows your agents to quickly visualize if the user clicked on a result. It displays a Viewed by Customer above the result seen.

  1. Access the Lightning Insight Panel.
  2. Access the Edit mode of the Lightning Insight Panel.
  3. Access the Code View tab.
  4. Insert the following code in a coveo-result cell, within a <div class="coveo-result-row"> element:

    <span class="CoveoViewedByCustomer"></span>
    

You can also add the Viewed by Customer component in the AttachedResults component by using the same steps directly in the Visualforce component.

Changing the Full Search Page’s Search Hub

You must set the fullSearchComponent option in your Lightning Insight Panel (see AgentPanel Lightning Component)

  1. Log in to your Salesforce organization using an administrator account.
  2. Open your Developer Console.
  3. Create a new Lightning component (see Create Aura Components in the Developer Console), using the following code sample:
<aura:component implements="flexipage:availableForRecordHome,lightning:isUrlAddressable" access="global" >
    <CoveoV2:FullSearch name="coveoFullSearch" searchHub="MySearchHub" pageReference="{! v.pageReference}"></CoveoV2:FullSearch>
</aura:component>

What’s Next?

You can customize the Coveo Lightning Insight Panel by using the options panel (see Customizing the Lightning Insight Panel Options).