Add the UserActions component to the Coveo Insight Panel Lightning Component

The UserActions component allows users of the Coveo Insight Panel Lightning Component to analyze a contact’s recent activities, such as user queries, clicked documents, and page views.

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

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

Session Summary and User Activity Timeline

The UserActions component displays the 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. The newest events are 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. The data retention limit is 60 days and the latest 400 events (all sessions combined) can be displayed.

Note

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).

Tip
Tip

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

Add the UserActions component

Important
Important

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 enable 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>
    Notes
    • 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 UserActions component to use a specific field to retrieve the user’s activity

By default, the UserActions 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 UserActions component on a Salesforce object type other than Case.

To do so, you must configure the Coveo Insight Panel Lightning Component to use the correct field to 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
    Example

    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 UserActions component configuration

Note

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

When the UserActions 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.

Manage the Viewed by Customer label

When the UserActions 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.

Important
Important

The Viewed by Customer label can’t be used if the UserActions component isn’t initialized in your search interface

Note

The Viewed by Customer label is automatically added in the default page template. For AttachedResults components created before the Coveo for Salesforce v3.43 release, 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>

Use the Viewed by Customer label without the UserActions component

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

  1. Add the UserActions component in your search interface.

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

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

Customize 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:

Important
Important

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

  1. Add the UserActions component in your search interface.

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

    • Use the Interface Editor to drag, 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

      This option is available in Coveo for Salesforce v3.42 and later releases.

    • 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.