Adding the User Actions component to the Coveo Insight Panel Lightning Component

Lightning Experience

Coveo for Salesforce 3.38 (August 2019)

The User Actions component allows users of the Coveo Insight Panel Lightning Component to analyze all of a contact’s recent activities, such as user queries, clicked documents, and page views. It records up to 2,000 events.

Once integrated in a search interface, the component automatically displays the Viewed by Customer label.

To ensure that the actions taken by a user during their multiple visits are displayed accurately, the User Actions component leverages the Coveo User Stitching service of the User profile.

This component is available for the Coveo Insight Panel Lightning Component, as well as the Full Search page.

Session Summary and User Activity Timeline

Coveo for Salesforce 4.23 (March 2022)

The latest User Actions component displays the following Session Summary and User Activity Timeline details.

3129-user-actions-panel

The Session Summary section highlights the Most Recent Clicked Documents (limit of three documents) and the Most Recent Queries (limit of three queries).

The User Activity Timeline section displays the session in which the case submit action (that is, ticketCreationDateTime) took place.

Newest events are always displayed at the top of the timeline.

A total of five sessions can be displayed by the timeline. The Show new session menu displays the two sessions that occurred after the case submit action took place. The Show past session menu displays the two sessions that occurred before the case submit action took place.

In some cases, you may want to exclude custom actions that provide no value from being displayed in the User Activity Timeline because they don’t provide relevant or valuable data for the agent.

To exclude custom actions from the timeline, you must edit the Excluded Custom Actions option of the Coveo Insight Panel Lightning Component (see Step 3: Customize the Coveo Insight Panel Lightning Component options).

The search hub is displayed when you hover over an event.

Enabling User Action History

To enable User Action History in your Coveo organization, perform the following steps:

  1. On the Models (platform-ca | platform-eu | platform-au) page of the Coveo Administration Console, in the upper-right corner, click MoreIcon.

  2. Enable User Action History.

In order to process your usage analytics data, it may take more than an hour for User Action History to be enabled in your organization.

Adding the User Actions component

User Actions are part of the Coveo Insight Panel Lightning Component by default in Coveo for Salesforce (v4.6) and later releases. If you implemented your Coveo Insight Panel Lightning Component before v4.6, we highly recommend upgrading to the new design to activate the new experience.

The information in this section applies to customers who are running Coveo for Salesforce (v4.4) or earlier releases.

  1. In Salesforce, access your Lightning Application (for example, Lightning Service Console), and then open any record (for example, Case).
  2. Access your Coveo Insight Panel Lightning Component.

  3. In the upper-right corner of the component, click CogIcon, and then select Edit.

  4. In the Interface Editor, select the Code View tab.

  5. Insert the following code directly below the closing tag of the <div class="coveo-search-section"></div> element:

    <div class="CoveoUserActions"></div>
    
    • Ensure that you don’t insert the code in the result template or in the coveo-main-section.

    • The Start Date is displayed in the language of your browser.

Configure the User Actions component to use a specific field to retrieve the user’s activity

Coveo for Salesforce 3.46 (February 2020)

By default, the User Actions component shows actions performed by the user who’s email address is specified in the email field on a case record.

You may want to change this default behavior for two reasons:

  • If the email address of the user who created the case is stored in a different field on the case record.
  • If you want to use the User Actions component on a Salesforce object type other than Case.

In order to do so, you must configure the Coveo Insight Panel Lightning Component to use the correct fieldto retrieve the user’s activity.

  1. Access your Coveo Insight Panel Lightning Component.
  2. In the upper-right corner of the component, click the cogwheel icon, and then select Advanced Configuration.

    3129-AccessdvancedConfiguration

  3. In the Advanced Server-Side Configuration panel, locate User Actions email fields, and then set the field that contains the user’s e-mail address.

    3129-UserActionsEmailField

    Suppose you’re integrating the Coveo Insight Panel Lightning Component in the Contact record page. To display the current contact’s user actions, you would set User Actions email fields to Email.

Validate the User Actions component configuration

Coveo for Salesforce 3.46 (February 2020)

The information in this section applies to customers who are running Coveo for Salesforce (v4.4) or earlier releases.

When the User Actions component is configured correctly, the User Actions button appears in the Coveo Insight Panel Lightning Component.

3129-UserActionsButton

If the User Actions button isn’t visible, verify the field specified in User Actions email fields. It should:

  • Exist on the Salesforce object type and be referenced by its API name.

  • Have a value on the current record.

  • Be visible to the user opening the current record page.

Managing the Viewed by Customer label

Coveo for Salesforce 3.39 (August 2019)

When the User Actions component is added to a search interface, the Viewed by Customer label is automatically displayed in search results that the related contact has previously viewed.

The Viewed by Customer label cannot be used if the User Actions component isn’t initialized in your search interface

Coveo for Salesforce 3.43 (December 2019) The Viewed by Customer label is automatically added in the default page template. For AttachedResults components created before the release of Coveo for Salesforce v3.43, you can either delete the page template or include the HTML element in your search interface.

<div class="CoveoUserActions" data-hidden="true" data-viewed-by-customer="true"></div>

Using the Viewed by Customer label without the User Actions component

You may want to take advantage of the Viewed by Customer label without using the User Actions component in your search interfaces. To achieve this, you must hide the User Actions component in your search interface, and then enable the data-viewed-by-customer Component option:

  1. Add the User Actions component in your search interface.

  2. Modify the User Actions element added in Step 1 as follows:

    <div class="CoveoUserActions" data-hidden="true" data-viewed-by-customer="true"></div>
    
  3. Click Save.

Customizing the Viewed by Customer label

You may want to modify the position of the Viewed by Customer label in your search results. To achieve this, you must use the CoveoViewedByCustomer component in your result templates:

The CoveoViewedByCustomer component won’t work if the User Actions Component isn’t initialized on your search interface.

  1. Add the User Actions component in your search interface.

  2. Use one of the following procedures to add the CoveoViewedByCustomer component:

    • Coveo for Salesforce 3.42 (November 2019) Use the Interface Editor to drag and drop, move, or delete the component in the result template. You can modify the Label, if needed, or use the Visibility checkbox to display an icon beside the results viewed by the customer.

      ViewedByCustomerIE

    • Access the Code View tab and insert the following code in a coveo-result cell, within a <div class="coveo-result-row"> element:

      <span class="CoveoViewedByCustomer"></span>
      
  3. Click Save.