GoogleCloudRecommendationengineV1beta1UserEvent
UserEvent captures all metadata information recommendation engine needs to know about how end users interact with customers' website.
Properties
| Name | Type | Description |
|---|---|---|
| userInfo | object | Required. User information. |
| eventTime | string | Optional. Only required for ImportUserEvents method. Timestamp of user event created. |
| productEventDetail | object | Optional. Retail product specific user event metadata. This field is required for the following event types: * `add-to-cart` * `add-to-list` * `category-page-view` * `checkout-start` * `detail-page-vi |
| eventSource | string | Optional. This field should *not* be set when using JavaScript pixel or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. |
| eventType | string | Required. User event type. Allowed values are: * `add-to-cart` Products being added to cart. * `add-to-list` Items being added to a list (shopping list, favorites etc). * `category-page-view` Special |
| eventDetail | object | Optional. User event detailed information common across different recommendation types. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://artifacts.apis.io/google-cloud-recommendations-ai/json-schema/google-cloud-recommendations-ai-google-cloud-recommendationengine-v1beta1-user-event-schema.json",
"title": "GoogleCloudRecommendationengineV1beta1UserEvent",
"description": "UserEvent captures all metadata information recommendation engine needs to know about how end users interact with customers' website.",
"x-generated": "2026-11-11",
"x-method": "derived",
"x-generator": "derive-json-schema.py",
"x-source": "openapi/google-cloud-recommendations-ai-recommendationengine-projects-api-openapi.yml#/components/schemas/GoogleCloudRecommendationengineV1beta1UserEvent",
"properties": {
"userInfo": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1UserInfo",
"description": "Required. User information."
},
"eventTime": {
"type": "string",
"format": "google-datetime",
"description": "Optional. Only required for ImportUserEvents method. Timestamp of user event created."
},
"productEventDetail": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1ProductEventDetail",
"description": "Optional. Retail product specific user event metadata. This field is required for the following event types: * `add-to-cart` * `add-to-list` * `category-page-view` * `checkout-start` * `detail-page-view` * `purchase-complete` * `refund` * `remove-from-cart` * `remove-from-list` * `search` This field is optional for the following event types: * `page-visit` * `shopping-cart-page-view` - note that 'product_event_detail' should be set for this unless the shopping cart is empty. This field is not allowed for the following event types: * `home-page-view`"
},
"eventSource": {
"description": "Optional. This field should *not* be set when using JavaScript pixel or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.",
"type": "string",
"enum": [
"EVENT_SOURCE_UNSPECIFIED",
"AUTOML",
"ECOMMERCE",
"BATCH_UPLOAD"
]
},
"eventType": {
"description": "Required. User event type. Allowed values are: * `add-to-cart` Products being added to cart. * `add-to-list` Items being added to a list (shopping list, favorites etc). * `category-page-view` Special pages such as sale or promotion pages viewed. * `checkout-start` User starting a checkout process. * `detail-page-view` Products detail page viewed. * `home-page-view` Homepage viewed. * `page-visit` Generic page visits not included in the event types above. * `purchase-complete` User finishing a purchase. * `refund` Purchased items being refunded or returned. * `remove-from-cart` Products being removed from cart. * `remove-from-list` Items being removed from a list. * `search` Product search. * `shopping-cart-page-view` User viewing a shopping cart. * `impression` List of items displayed. Used by Google Tag Manager.",
"type": "string"
},
"eventDetail": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1EventDetail",
"description": "Optional. User event detailed information common across different recommendation types."
}
},
"type": "object",
"$defs": {
"GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy": {
"type": "object",
"properties": {
"categories": {
"description": "Required. Catalog item categories. Each category should be a UTF-8 encoded string with a length limit of 2 KiB. Note that the order in the list denotes the specificity (from least to most specific).",
"items": {
"type": "string"
},
"type": "array"
}
},
"description": "Category represents catalog item category hierarchy."
},
"GoogleCloudRecommendationengineV1beta1EventDetail": {
"description": "User event details shared by all recommendation types.",
"properties": {
"uri": {
"description": "Optional. Complete url (window.location.href) of the user's current page. When using the JavaScript pixel, this value is filled in automatically. Maximum length 5KB.",
"type": "string"
},
"pageViewId": {
"type": "string",
"description": "Optional. A unique id of a web page view. This should be kept the same for all user events triggered from the same pageview. For example, an item detail page view could trigger multiple events as the user is browsing the page. The `pageViewId` property should be kept the same for all these events so that they can be grouped together properly. This `pageViewId` will be automatically generated if using the JavaScript pixel."
},
"experimentIds": {
"items": {
"type": "string"
},
"description": "Optional. A list of identifiers for the independent experiment groups this user event belongs to. This is used to distinguish between user events associated with different experiment setups (e.g. using Recommendation Engine system, using different recommendation models).",
"type": "array"
},
"eventAttributes": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1FeatureMap",
"description": "Optional. Extra user event features to include in the recommendation model. For product recommendation, an example of extra user information is traffic_channel, i.e. how user arrives at the site. Users can arrive at the site by coming to the site directly, or coming through Google search, and etc."
},
"recommendationToken": {
"description": "Optional. Recommendation token included in the recommendation prediction response. This field enables accurate attribution of recommendation model performance. This token enables us to accurately attribute page view or purchase back to the event and the particular predict response containing this clicked/purchased item. If user clicks on product K in the recommendation results, pass the `PredictResponse.recommendationToken` property as a url parameter to product K's page. When recording events on product K's page, log the PredictResponse.recommendation_token to this field. Optional, but highly encouraged for user events that are the result of a recommendation prediction query.",
"type": "string"
},
"referrerUri": {
"type": "string",
"description": "Optional. The referrer url of the current page. When using the JavaScript pixel, this value is filled in automatically."
}
},
"type": "object"
},
"GoogleCloudRecommendationengineV1beta1FeatureMap": {
"type": "object",
"properties": {
"numericalFeatures": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1FeatureMapFloatList"
},
"description": "Numerical features. Some examples would be the height/weight of a product, or age of a customer. Feature names must be UTF-8 encoded strings. For example: `{ \"lengths_cm\": {\"value\":[2.3, 15.4]}, \"heights_cm\": {\"value\":[8.1, 6.4]} }`"
},
"categoricalFeatures": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1FeatureMapStringList"
},
"description": "Categorical features that can take on one of a limited number of possible values. Some examples would be the brand/maker of a product, or country of a customer. Feature names and values must be UTF-8 encoded strings. For example: `{ \"colors\": {\"value\": [\"yellow\", \"green\"]}, \"sizes\": {\"value\":[\"S\", \"M\"]}`"
}
},
"description": "FeatureMap represents extra features that customers want to include in the recommendation model for catalogs/user events as categorical/numerical features."
},
"GoogleCloudRecommendationengineV1beta1FeatureMapFloatList": {
"description": "A list of float features.",
"properties": {
"value": {
"description": "Float feature value.",
"items": {
"type": "number",
"format": "float"
},
"type": "array"
}
},
"type": "object"
},
"GoogleCloudRecommendationengineV1beta1FeatureMapStringList": {
"description": "A list of string features.",
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"type": "string"
},
"description": "String feature value with a length limit of 128 bytes."
}
}
},
"GoogleCloudRecommendationengineV1beta1ProductDetail": {
"type": "object",
"description": "Detailed product information associated with a user event.",
"properties": {
"itemAttributes": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1FeatureMap",
"description": "Optional. Extra features associated with a product in the user event."
},
"displayPrice": {
"description": "Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.",
"format": "float",
"type": "number"
},
"availableQuantity": {
"format": "int32",
"type": "integer",
"description": "Optional. Quantity of the products in stock when a user event happens. Optional. If provided, this overrides the available quantity in Catalog for this event. and can only be set if `stock_status` is set to `IN_STOCK`. Note that if an item is out of stock, you must set the `stock_state` field to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not sufficient to mark the item out of stock."
},
"quantity": {
"type": "integer",
"format": "int32",
"description": "Optional. Quantity of the product associated with the user event. For example, this field will be 2 if two products are added to the shopping cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event types."
},
"originalPrice": {
"type": "number",
"format": "float",
"description": "Optional. Original price of the product. If provided, this will override the original price in Catalog for this product."
},
"stockState": {
"enum": [
"STOCK_STATE_UNSPECIFIED",
"IN_STOCK",
"OUT_OF_STOCK",
"PREORDER",
"BACKORDER"
],
"description": "Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.",
"type": "string"
},
"currencyCode": {
"description": "Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.",
"type": "string"
},
"id": {
"description": "Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.",
"type": "string"
}
}
},
"GoogleCloudRecommendationengineV1beta1ProductEventDetail": {
"type": "object",
"properties": {
"productDetails": {
"description": "The main product details related to the event. This field is required for the following event types: * `add-to-cart` * `add-to-list` * `checkout-start` * `detail-page-view` * `purchase-complete` * `refund` * `remove-from-cart` * `remove-from-list` This field is optional for the following event types: * `page-visit` * `shopping-cart-page-view` - note that 'product_details' should be set for this unless the shopping cart is empty. * `search` (highly encouraged) In a `search` event, this field represents the products returned to the end user on the current page (the end user may have not finished broswing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a new SEARCH event with different product_details is desired. The end user may have not finished broswing the whole page yet. This field is not allowed for the following event types: * `category-page-view` * `home-page-view`",
"items": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1ProductDetail"
},
"type": "array"
},
"purchaseTransaction": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1PurchaseTransaction",
"description": "Optional. A transaction represents the entire purchase transaction. Required for `purchase-complete` events. Optional for `checkout-start` events. Other event types should not set this field."
},
"listId": {
"description": "Required for `add-to-list` and `remove-from-list` events. The id or name of the list that the item is being added to or removed from. Other event types should not set this field.",
"type": "string"
},
"searchQuery": {
"description": "At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. The user's search query as UTF-8 encoded text with a length limit of 5 KiB.",
"type": "string"
},
"pageCategories": {
"description": "Required for `category-page-view` events. At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. The categories associated with a category page. Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: categories : [\"Sales\", \"2017 Black Friday Deals\"].",
"type": "array",
"items": {
"$ref": "#/$defs/GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy"
}
},
"cartId": {
"description": "Optional. The id or name of the associated shopping cart. This id is used to associate multiple items added or present in the cart before purchase. This can only be set for `add-to-cart`, `remove-from-cart`, `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.",
"type": "string"
}
},
"description": "ProductEventDetail captures user event information specific to retail products."
},
"GoogleCloudRecommendationengineV1beta1PurchaseTransaction": {
"type": "object",
"description": "A transaction represents the entire purchase transaction.",
"properties": {
"revenue": {
"format": "float",
"description": "Required. Total revenue or grand total associated with the transaction. This value include shipping, tax, or other adjustments to total revenue that you want to include as part of your revenue calculations. This field is not required if the event type is `refund`.",
"type": "number"
},
"currencyCode": {
"description": "Required. Currency code. Use three-character ISO-4217 code. This field is not required if the event type is `refund`.",
"type": "string"
},
"id": {
"description": "Optional. The transaction ID with a length limit of 128 bytes.",
"type": "string"
},
"taxes": {
"type": "object",
"description": "Optional. All the taxes associated with the transaction.",
"additionalProperties": {
"type": "number",
"format": "float"
}
},
"costs": {
"additionalProperties": {
"type": "number",
"format": "float"
},
"description": "Optional. All the costs associated with the product. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs. Total product cost such that profit = revenue - (sum(taxes) + sum(costs)) If product_cost is not set, then profit = revenue - tax - shipping - sum(CatalogItem.costs). If CatalogItem.cost is not specified for one of the items, CatalogItem.cost based profit *cannot* be calculated for this Transaction.",
"type": "object"
}
}
},
"GoogleCloudRecommendationengineV1beta1UserInfo": {
"type": "object",
"properties": {
"ipAddress": {
"description": "Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be set when using the javascript pixel or if `direct_user_request` is set. Used to extract location information for personalization.",
"type": "string"
},
"visitorId": {
"type": "string",
"description": "Required. A unique identifier for tracking visitors with a length limit of 128 bytes. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. Maximum length 128 bytes. Cannot be empty. Don't set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality."
},
"directUserRequest": {
"description": "Optional. Indicates if the request is made directly from the end user in which case the user_agent and ip_address fields can be populated from the HTTP request. This should *not* be set when using the javascript pixel. This flag should be set only if the API request is made directly from the end user such as a mobile app (and not if a gateway or a server is processing and pushing the user events).",
"type": "boolean"
},
"userId": {
"description": "Optional. Unique identifier for logged-in user with a length limit of 128 bytes. Required only for logged-in users. Don't set for anonymous users. Don't set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality.",
"type": "string"
},
"userAgent": {
"description": "Optional. User agent as included in the HTTP header. UTF-8 encoded string with a length limit of 1 KiB. This should *not* be set when using the JavaScript pixel or if `directUserRequest` is set.",
"type": "string"
}
},
"description": "Information of end users."
}
}
}
Work with this as data
Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for schemas
4 MCP tools reach this
find_json_schemasBrowse and filter every JSON Schema in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
curl "https://apis.io/api/v1/json-schemas/google-cloud-recommendations-ai-google-cloud-recommendationengine-v1beta1-user-event"
curl "https://apis.io/api/v1/json-schemas?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.