User Events and Google Vertex AI Search for Retail

Learn why collecting user events at the beginning of a Vertex AI implementation helps ensure data quality and accelerate recommendations model training.

Sebastian Hooker

Sebastian Hooker

Never Miss an Update

By entering your email, you agree to receive marketing emails from us.


Table of Contents

    Introduction

    Vertex AI Search for Retail is only as powerful as the data that you feed it. In addition to syncing your product catalog with the Retail API, recording real-time user events allows Google’s AI algorithms to deliver great recommendations and search results that improve over time. User events are required for almost every single Recommendations AI model type, while also helping unlock higher data quality tiers to deliver personalized, revenue-focused search and browse results.

    You only need to ingest one set of user events for both search and recommendations. While Google Cloud has split up search and recommendations into two separate product families in their marketing materials, both products leverage the same underlying Retail API and both products are configured together in the Google Cloud Console.

    Finally, if you landed here from this video on YouTube, welcome to our website! If you haven’t watched it yet, it may be a great primer to solidify your understanding of user events in tandem with this article.

    User Event Challenges

    User events are notoriously difficult to get right, but investing in the implementation and working through the challenges drastically improves the overall performance of your final Vertex AI Search for Retail implementation.

    Unfortunately we’ve seen some implementation projects where a retailer has uploaded their product catalog perfectly, variants and all, but waited six to eight months to connect user events to the APIs correctly. Once the full set of user events were flowing, search quality improved by double digit percentages, recommendations models were unlocked, and the retailer could have been seeing better results earlier if they focused on better user event collection up front. While it can be frustrating to configure the components correctly, we don’t recommend going live without them or else you’ll likely be spending a lot of unnecessary time and money on a premium (yet underpowered) product. If you need help understanding the complexity or some short term consulting to help get it right, feel free to schedule a call with us.

    Real-Time Event Ingestion

    Recording real-time user events typically comes down to installing a JavaScript pixel, adding a Tag Manager tag, or sending events directly to the API from your back-end server. Most Retail API customers choose to use Google Tag Manager. We won’t recreate Google Cloud’s own documentation in this article, so we’ll leave with a few recommendations instead:

    • Use the Data Layer as the User Event Data Source field if you use Google Tag Manager

    • Look for unjoined events in the Events tab on the Data page in the console

    • Anonymize users with secure, unique identifiers to protect privacy and avoid including PII

    • Test, test, test! Use preview mode in Google Tag Manager, and place a real order! 

    Historical Data

    If you’ve been collecting similar user events through Google Analytics, Adobe Omniture, or another ecommerce reporting system for the past several months, you may be able to repurpose that data to accelerate model training in Vertex AI Search for Retail. This won’t be a one for one mapping and will take some transformation to align with the Retail API’s expectation of data formatting. If you do have a massive amount of data, be sure to limit bulk imports to 2GB per file and check for errors by clicking the “Activity Status” button on the top right of the Data page.

    API Keys

    The User Events collection endpoint is the only endpoint that allows an API key to be used for authentication. All other calls to Google Cloud’s Retail API endpoints require a service account to authenticate. Many early users to the Retail API get frustrated when attempting to retrieve search results using this API key - but it will never work.

    Simply follow these instructions to create an API key for user events.

    Bot Traffic

    There are some aggressive crawlers and bots that hammer product and collection pages to scrape data. These crawlers may be sending User Event data to the Retail API that negatively affects your search results and recommendations models. If you notice a large spike in a specific subset of events, consider checking your firewall or CDN logs to understand if it is human or bot traffic. Limiting User Events to users may result in a smaller number of events, but doing so will ensure that the AI models are tuned for humans - not robots… Sorry ChatGPT! 

    User Event Benefits

    Once User Events are collected correctly, a game of patience begins. Both data quality and model training will be impacted by the amount of traffic that your website gets. On a large enterprise brand with millions of users, results will be quick. On smaller brands, expect to wait up to 2 to 3 months before seeing the benefits of user events. This crucial reason highlights the importance of configuring user events correctly early, because any delay can be further exacerbated by waiting for user traffic.

    Search & Browse Data Quality

    User events are used to increase the quality of both search and browse events. Each tier of data search quality is unlocked by user events. Every new Retail API customer begins in Tier 1, or “Relevance” mode. Following Relevance mode, the algorithms enter “Relevance & Popularity” and gradually work themselves up to fully personalized revenue.

    The screenshot below shows an example of an ecommerce website moving from Tier 1 to Tier 2, and the threshold requirements to jump into the next data quality tier.

    Vertex AI Search for Retail User Events Data Quality

    Recommendations AI Models

    User events are required for all but one recommendation model. You may notice that each recommendation type requires a different subset and quantity of user events. For example, training an Others You May Like model that optimizes for Conversion Rate (CVR) requires more data than a model that optimizes for Click-Through Rate (CTR).

    Assuming they are active, the models will continue to improve after their initial training is complete using the latest user events that are ingested.

    Vertex AI Search for Retail User Events Recommendations Models

    Going Live

    Once you’re confident in your initial implementation of user events, you can monitor the import health and set up alerts for data quality issues. When you visit the Events tab in the Data page in the console, you should see all of the events ingested over the last year. 

    Vertex AI Search for Retail User Events Chart

    Retail Cloud Connect

    Nimstrata offers a fully managed SaaS platform to connect major ecommerce platforms, such as Shopify, directly to Google Cloud’s Vertex AI Search for Retail product. You may find that even if you use Google’s native Shopify App and Google Merchant Center to sync your product catalog with Vertex AI, you’re still missing your user events and the necessary serving components.

    However, the biggest benefit of using Retail Cloud Connect is a simplified setup process and the fastest time to value.

    Google Cloud Vertex AI Search for Retail is a fairly new product, and occasionally the engineering team at Google will add new user event types to ingest. For example, in June of 2024 they added the “Remove from Cart” user event. As of July 2024, this had not been documented, because it is being used for testing and rolling out slowly. However, we’ve already added it to the Retail Cloud Connect platform to ensure that all of our users are prepared for the latest model capabilities without needing to revisit their implementation or Google Tag Manager settings.

    You also don’t need to worry about bot traffic, API Keys, Service Accounts, or any other authentication methods. Simply following our initial installation steps after installing the Shopify App will take care of everything.

    If you’re not on the Shopify platform, Nimstrata offers consulting packages, custom implementations, and long-term managed services to help you make the most out of your investment in AI on your ecommerce storefront.

    Unlock Your Full Shopify Potential

    See how Google Cloud is unmatched in delivering the best search and recommendations.