Smart Snippets Custom Events

Smart Snippets provides users a quick way to obtain the information that they’re looking for without having to open the links retrieved after a query is performed. From an analytics perspective, custom events are logged to track the usage of a snippet. Every user interaction performed on the main snippet or in the related questions triggers a custom event that is tracked by Coveo Usage Analytics (UA).

To understand what is tracked, you can inspect the search page which uses the Smart Snippets feature and retrieves the custom events in question. This article also provides a reference for the custom events that are tracked by Coveo UA.

Inspect Your Search Page

Use your browser developer tools to retrieve what is tracked:

  1. Open a Coveo-powered search page configured to leverage Coveo ML Smart Snippets.

  2. Access your browser developer tools.

    DevTools

  3. In the developer tools window, click the Network tab.

  4. On the search page, perform a query that will trigger a Smart Snippet in the search results.

  5. On the snippet, or on one of the related questions, perform an action (e.g. Click Show More to expand the snippet).

  6. Back in the developer tools window, under the Name column, click the latest custom Search API call. When hovering over the request, the path should contain /rest/ua/v15/analytics/custom.

  7. Select the Payload tab. You should now see the tracked custom event.

In the following example, the question What is the thesaurus? is queried in the search page. This triggers a snippet that provides the user with enough information, therefore they click Yes next to Was this useful?. This action is visible in the latest request to the Search API in the developer tools, which in this case is custom?org=.

Inspect event example

Custom Events Reference

The following custom events are logged in the JSUI v2.10090 (or a later version) and in Coveo Headless library:

Custom events Value Triggered

Clicks

  • actionCause: openSmartSnippetSource

  • actionCause: openSmartSnippetSuggestionSource

When you open the link featured in the snippet.

Show More/Less

  • eventType: smartSnippet

  • eventValue: expandSmartSnippet and collapseSmartSnippet

  • actionType: smartSnippet

  • actionCause: expandSmartSnippet and collapseSmartSnippet

When you select Show More or Show Less

Accordion open/close

  • eventType: smartSnippet

  • eventValue: expandSmartSnippetSuggestion and collapseSmartSnippetSuggestion

  • actionType: smartSnippet

  • actionCause: expandSmartSnippetSuggestion and collapseSmartSnippetSuggestion

When you expand a People also ask suggestion.

Was this useful?

  • eventType: smartSnippet

  • eventValue: likeSmartSnippet and dislikeSmartSnippet

  • actionType: smartSnippet

  • actionCause: likeSmartSnippet and dislikeSmartSnippet

When you select Yes or No for Was this useful?.

Explain Why

  • eventType: smartSnippet

  • eventValue: openSmartSnippetFeedbackModal and closeSmartSnippetFeedbackModal(clicking on the X )

  • actionType: smartSnippet

  • actionCause: openSmartSnippetFeedbackModal and closeSmartSnippetFeedbackModal (clicking on the X )

When you click Explain why from Was this useful?.

Send

  • eventType: smartSnippet

  • eventValue: sendSmartSnippetReason and closeSmartSnippetFeedbackModal (for cancel)

  • actionType: smartSnippet

  • actionCause: sendSmartSnippetFeedbackModal and closeSmartSnippetFeedbackModal (for cancel)

When you send a reason from the Explain why pop-up.

What's next for me?