Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to have custom events on GCP vertex AI search

 

So I am using Vertex AI Search with my custom UI and I want to record user actions like clicking (thumbs up, thumbs down, or clicking on links returned in the search) and pass it to the model.

I need them for 2 reasons

First I want to improve the responses from the model

Second I want to record those events for further analysis

How can I achieve this? I have looked into Vertex search events but the documents seems to be around for a specific usecase.

0 2 184
2 REPLIES 2

Hi @Deevendhu ,

Use the Vertex AI Search userEvents API to log clicks, thumbs up/down, etc.

This lets you both analyze user behavior and later improve model relevance.

Hi @Deevendhu,

Welcome to Google Cloud Community!

In Enhancing Your Custom Vertex AI Search with User Feedback, You can effectively record user interactions like clicks and ratings within your custom user interface to both enhance your Vertex AI Search model and gather valuable analytics. This is achieved by sending user event data to the Vertex AI Search API.

By capturing user actions, you provide crucial feedback to the underlying search model, enabling it to learn and deliver more relevant results over time. This process of collecting user interactions is fundamental to improving the performance and accuracy of your search application.

The primary method for sending this information is through the userEvents.write API endpoint. This endpoint accepts a payload containing details about the user's interaction.

Key event types you'll want to capture include:

  • Search: When a user performs a search. This helps the model understand which queries are common and what results are being shown.
  • View Item : When a user clicks on a search result. This is a strong positive signal to the model that the clicked result was relevant to the query. You can use the detail-page-view event type for this purpose.
  • Feedback (Thumbs Up/Down): When a user explicitly rates the search results. This provides direct feedback on the quality of the results. While there isn't a specific "feedback" event type, you can leverage a detail-page-view event and include custom attributes to represent the rating. With this, you can check this document that shows how to enable feedback buttons in the pre-built search widget. You can use this as an inspiration for the kind of data to send in your custom events for thumbs up/down actions.

Note that, for user events within the "Vertex AI Search for commerce" context, the fundamental principles and the userEvents.write API are applicable to general search implementations.

For Recording Events, The same user event data sent to improve the model is also available for your own analysis. By logging these interactions, you can gain insights into user behavior, popular search terms, and the overall effectiveness of your search solution.

You can view and analyze this data in the Analytics section of your Vertex AI Search application in the Google Cloud Console. The dashboard provides an overview of key metrics, and you can delve deeper to understand trends and patterns in how users are interacting with your search results.

For more advanced and customized analysis, you can export this data to other Google Cloud services like BigQuery. This allows you to run complex queries, create custom visualizations, and join the search interaction data with other business datasets for a more comprehensive understanding of your users.

In addition, You can also refer to this GitHub repository as a baseline for troubleshooting. For a broader understanding of building and integrating Vertex AI Search applications, you can also try this Lab.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.