class Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1ProductEventDetail

ProductEventDetail captures user event information specific to retail products.

Attributes

cart_id[RW]

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. Corresponds to the JSON property `cartId` @return [String]

list_id[RW]

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. Corresponds to the JSON property `listId` @return [String]

page_categories[RW]

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”]. Corresponds to the JSON property `pageCategories` @return [Array<Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy>]

product_details[RW]

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` Corresponds to the JSON property `productDetails` @return [Array<Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1ProductDetail>]

purchase_transaction[RW]

A transaction represents the entire purchase transaction. Corresponds to the JSON property `purchaseTransaction` @return [Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1PurchaseTransaction]

search_query[RW]

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. Corresponds to the JSON property `searchQuery` @return [String]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/recommendationengine_v1beta1/classes.rb, line 1416
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/recommendationengine_v1beta1/classes.rb, line 1421
def update!(**args)
  @cart_id = args[:cart_id] if args.key?(:cart_id)
  @list_id = args[:list_id] if args.key?(:list_id)
  @page_categories = args[:page_categories] if args.key?(:page_categories)
  @product_details = args[:product_details] if args.key?(:product_details)
  @purchase_transaction = args[:purchase_transaction] if args.key?(:purchase_transaction)
  @search_query = args[:search_query] if args.key?(:search_query)
end