Google Agent Search

📘

This integration is currently in beta. Contact your MetaRouter support team to get started.

What Is Google Agent Search?

Google Agent Search (formerly Vertex AI Search) is Google Cloud's managed search and recommendations product that lets businesses build Google-quality search experiences over their own content and product catalogs. It ranks and personalizes results using machine learning trained on the business's catalog and on user behavior. By recording user events such as searches, page views, and item views, businesses help Agent Search learn which results users engage with, so higher-performing results are boosted and lower-performing ones are demoted. The MetaRouter integration sends these user events server-to-server to a customer's Agent Search data store.


Product Type: Search & Recommendations
Integration Type: Starter Kit
Event Source Type: Web
Event Scope: Upper/Mid-Funnel Events


Capabilities

  • Sends search, page, product list, and product view events to a Google Agent Search data store.
  • Feeds user behavior into Agent Search to improve search ranking and personalization.
  • Links product events to items in the customer's Agent Search catalog using product IDs.
  • Classifies page views as home page or category page views automatically.
  • Authenticates using a Google Cloud service account.

Considerations

  • Google markets this product as Agent Search (previously Vertex AI Search), but in Google Cloud the API and service are listed as Discovery Engine. A similar product, Vertex AI Search for commerce, uses the same logo but is a different product. It is supported through MetaRouter's AI Commerce Search starter kit, not this integration.
  • This integration is built for data stores using the general (GENERIC) industry vertical. Cart and purchase events are rejected by this type of data store, even if the store uses a product schema. To send cart and purchase events, use the AI Commerce Search starter kit.
  • Products referenced in events must already be imported and indexed in the customer's Agent Search data store. If they are not, Google accepts the event but does not use it for training or results. Indexing can take minutes to hours on a new data store, and temporary throttling messages during this period resolve on their own.
  • Google does not provide a way to view individual events after they are sent. Delivery can only be confirmed through the API response and the aggregate user event metrics in the Google Cloud console, which can lag by several hours. A response with joined: true means the event was linked to a product; if joined is missing, the event was accepted but not linked.
  • PROJECT_NUMBER must be the numeric project number, not the text-based project ID.
  • LOCATION defaults to global and must match the location where the data store was created. This cannot be changed after the data store is created.
  • COLLECTION_ID is typically default_collection.
  • DATA_STORE_ID must match the target data store exactly. An incorrect value results in requests failing as not found.
  • The service account must have permission to create user events (included in the Discovery Engine Editor role). Without it, requests are rejected as permission denied (403).
  • Product Viewed events require a product ID, category page views require properties.category, and Products Searched events require a search query (properties.query).
  • If your site can send properties.category as null or an empty string, update the Page filter to require a non-empty category. Otherwise, those pages are sent to Agent Search as home page views.

Limitations

  • Only web events are supported.
  • Only general (GENERIC) data stores are supported. Cart, purchase, and media events cannot be sent through this starter kit.
  • The product ID sent in events must exactly match the document ID in the customer's indexed Agent Search catalog, or events will not be linked to products.
  • Only home page and category page views can be sent. All other page views are dropped.
  • There is no event-level read-back; success is limited to an HTTP 200 response, with joined: true present only when the event is linked to a product, and aggregate metrics are delayed.
  • Events are sent one per request. Batching is not supported.

Starter Kit Setup Guide

1. Gather Credentials

  • PROJECT_NUMBER: In the Google Cloud console, open the project dashboard. The project number is listed under Project info.
  • LOCATION: The location selected when the Agent Search data store was created (usually global).
  • COLLECTION_ID: Typically default_collection.
  • DATA_STORE_ID: In the Google Cloud console, go to AI Applications > Data Stores and copy the ID of the target data store.
  • SERVICE_ACCOUNT_EMAIL and PRIVATE_KEY: In the Google Cloud console, go to IAM & Admin > Service Accounts, create or select a service account with the Discovery Engine Editor role, and create a JSON key. The email and private key are found in the downloaded key file.

2. Add a Google Agent Search Integration

  • From the integration library, add a Google Agent Search integration. Then, fill out the Connection Parameters:
Connection ParameterDescription
PROJECT_NUMBERNumeric Google Cloud project number that owns the Agent Search data store.
LOCATIONLocation of the data store. Defaults to global.
COLLECTION_IDCollection containing the data store. Typically default_collection.
DATA_STORE_IDID of the Agent Search data store that receives events.
SERVICE_ACCOUNT_EMAILEmail of the Google Cloud service account used to authenticate requests.
PRIVATE_KEYPrivate key from the service account's JSON key file, used to sign authentication requests.

3. Configure Event Mapping

  • MetaRouter provides all of the event mappings that Google Agent Search integrations typically require. You may add custom events, parameters, or mappings in accordance with Google Agent Search’s API documentation.

4. Deploy to Pipeline

  • In the Pipelines tab, add your Google Agent Search integration.
  • Select the correct integration revision.
  • Click Add Integration and finalize deployment.

Event Mappings

Global

Global mappings will be applied to all events. If your parameter names do not match the Expected Inputs provided, you will need to overwrite the Inputs provided with your own.

Output KeyDescriptionExpected Input
userPseudoId RequiredString: Unique visitor identifier used to track users across sessions.anonymousId
eventTimeString: Event timestamp in RFC 3339 format.timestamp
userInfo.userAgentString: Browser user agent string.context.userAgent
pageInfo.uriString: URL of the page where the event occurred.context.page.url
pageInfo.referrerUriString: URL of the referring page.context.page.referrer

Event Specific

Products Searched

Output KeyDescriptionExpected Input
eventType RequiredString: Agent Search event type for search activity.Enrichment – 'search'
searchInfo.searchQuery RequiredString: Search query entered by the user.properties.query

Product List Viewed

Output KeyDescriptionExpected Input
eventType RequiredString: Agent Search event type for product list views.Enrichment – 'view-item-list'
documentsArray: Viewed products; each id must match a document ID in the indexed catalog.Expression – maps each properties.products[].product_id to id

Product Viewed

Output KeyDescriptionExpected Input
eventType RequiredString: Agent Search event type for product views.Enrichment – 'view-item'
documents RequiredArray: Viewed product; id must match a document ID in the indexed catalog.Expression – maps properties.product_id to id

Page

Output KeyDescriptionExpected Input
eventType RequiredString: view-category-page if a category is present, else view-home-page. Only home and category pages are sent.Expression – derived from properties.category and context.page.path
pageInfo.pageCategoryString: Category of the page viewed. Required for category page views.properties.category

Required & Recommended Identifiers

These identifiers must be mapped to Google Agent Search in order for successful user matching to occur. Without these IDs, any events sent to Google Agent Search may not be accurately reflected in reporting.

AttributeExampleSync Injector Required?
userPseudoId Requiredb171a9b06ce011ecafcd1b209be8601bNo
userInfo.userAgentMozilla/5.0 (Windows NT 10.0; Win64; x64)No

Integration Validation

Google Agent Search does not provide a per-event view in the Google Cloud console, so validation relies on the API responses returned to MetaRouter and on aggregate metrics in the console.

  • Before testing, confirm the products you plan to send are imported and indexed in your Agent Search data store, and that each product_id sent in events exactly matches a document ID in the data store. Newly imported products can take minutes to hours to finish indexing.
  • Send test events through your pipeline (for example, Page on a category page, Product List Viewed, Product Viewed, and Products Searched).
  • Review the vendor responses for each event and confirm each request returned an HTTP 200 response.
  • For product events, check the response for joined: true, which means the event was linked to a product in your data store. If joined is missing from the response, the event was accepted but not linked, usually because the product is missing from the data store or has not finished indexing. No error is returned in this case, so checking for joined: true is the most reliable check.
  • If requests fail, check the error details: a not found error (404) typically points to an incorrect PROJECT_NUMBER, LOCATION, COLLECTION_ID, or DATA_STORE_ID; an unauthorized error (401) means the SERVICE_ACCOUNT_EMAIL or PRIVATE_KEY is incorrect; and a permission denied error (403) means the service account is missing the Discovery Engine Editor role.
  • After events have been flowing for several hours, review the aggregate user event metrics for your data store in the Google Cloud console to confirm events are being recorded.

Additional Google Agent Search Documentation