Google Vertex AI Search
Beta
This feature is in Beta and may continue to evolve. This documentation may not reflect the latest updates.
This integration is in closed beta. Contact your Amplitude Client Success Manager for support.
Amplitude Data's Google Vertex AI integration streams your Amplitude event data to Google Cloud Vertex AI Search for Commerce.
Considerations
- Amplitude posts event data to Vertex AI's
userEvents.writeendpoint and maps each Amplitude event to the required Vertex AI schema using a FreeMarker template. - Confirm your mapping matches the Google Cloud User Events schema before you enable the destination.
Set up the integration
Prerequisites
Before you get started, create a Google IAM service account with appropriate access.
Amplitude needs four things from Vertex AI to set up the integration:
- Google service account JSON: Create a dedicated service account for the Amplitude Vertex AI integration. Refer to the Google documentation for help with this step.
- GCP project ID: The name of the GCP project where the retail catalog lives.
- Retail location: Use
globalunless you have a regional catalog. - Retail catalog ID: Use
default_catalogunless you've created additional catalogs.
Google Vertex AI setup
After you enable the Vertex AIuserEvents.write endpoint and create the service account, create a key for the service account. You need this key to complete Amplitude setup. Refer to the Google documentation for help with this step.Amplitude setup
- In Amplitude Data, go to Catalog > Destinations.
- In the Event Streaming section, click Google Vertex AI.
- Enter a sync name, then click Create Sync.
- Click Edit, then upload your service account JSON.
- Update GCP project ID, Retail location, and Retail catalog ID if necessary.
- Customize the payload using an Apache FreeMarker template. Refer to the FreeMarker templating language section.
- Use the Send events filter to select the events to send.
- When finished, enable the destination and click Save.
FreeMarker templating language
Amplitude uses Apache FreeMarker templates to transform Amplitude events into JSON that matches the Vertex AI User Event schema. Theinput variable refers to each event in Amplitude's export format.For advanced FreeMarker patterns, including datetime formatting and optional fields, refer to the Webhooks Streaming destination.More FreeMarker help
Refer to the FreeMarker guide to creating templates for more help.Example template
text
{
<#if input.user_id??>
"visitorId" : "${input.user_id}",
</#if>
"eventType" : "${input.event_type}",
"eventTime" : "${input.event_time}",
"productDetails" : [{
"product" : {
"id" : "${input.event_properties.product_id!}"
}
}]
}
Using this template sends the following JSON payload to the Vertex AI userEvents.write endpoint:
json
{
"visitorId": "some user id",
"eventType": "detail-page-view",
"eventTime": "2022-10-24T20:07:32.123Z",
"productDetails": [
{
"product": {
"id": "product-123"
}
}
]
}
Adjust field names and nested objects to match the event types and properties you send. Map Amplitude event_properties and user_properties to the Vertex AI fields your catalog requires.
Was this helpful?