# Recommendations AI V1beta1 API - Class Google::Cloud::RecommendationEngine::V1beta1::UserEvent (v0.18.0)

0.18.0 (latest) 0.17.1 0.16.0 0.15.1 0.14.0 0.13.0 0.12.1 0.11.0 0.10.0 0.9.2 0.8.2 0.7.0 0.6.1 0.5.0 0.4.1 0.3.7 Reference documentation and code samples for the Recommendations AI V1beta1 API class Google::Cloud::RecommendationEngine::V1beta1::UserEvent.

UserEvent captures all metadata information recommendation engine needs to
know about how end users interact with customers' website.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #event_detail

    def event_detail() -> ::Google::Cloud::RecommendationEngine::V1beta1::EventDetail

**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::EventDetail](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-EventDetail)) --- Optional. User event detailed information common across different recommendation types.

### #event_detail=

    def event_detail=(value) -> ::Google::Cloud::RecommendationEngine::V1beta1::EventDetail

**Parameter**

- **value** ([::Google::Cloud::RecommendationEngine::V1beta1::EventDetail](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-EventDetail)) --- Optional. User event detailed information common across different recommendation types.
**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::EventDetail](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-EventDetail)) --- Optional. User event detailed information common across different recommendation types.

### #event_source

    def event_source() -> ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent::EventSource

**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::UserEvent::EventSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-UserEvent-EventSource)) --- Optional. This field should *not* be set when using JavaScript pixel or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.

### #event_source=

    def event_source=(value) -> ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent::EventSource

**Parameter**

- **value** ([::Google::Cloud::RecommendationEngine::V1beta1::UserEvent::EventSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-UserEvent-EventSource)) --- Optional. This field should *not* be set when using JavaScript pixel or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::UserEvent::EventSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-UserEvent-EventSource)) --- Optional. This field should *not* be set when using JavaScript pixel or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.

### #event_time

    def event_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Protobuf-Timestamp)) --- Optional. Only required for ImportUserEvents method. Timestamp of user event created.

### #event_time=

    def event_time=(value) -> ::Google::Protobuf::Timestamp

**Parameter**

- **value** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Protobuf-Timestamp)) --- Optional. Only required for ImportUserEvents method. Timestamp of user event created.
**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Protobuf-Timestamp)) --- Optional. Only required for ImportUserEvents method. Timestamp of user event created.

### #event_type

    def event_type() -> ::String

**Returns**

- (::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 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.

### #event_type=

    def event_type=(value) -> ::String

**Parameter**

- **value** (::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 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.
**Returns**

- (::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 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.

### #product_event_detail

    def product_event_detail() -> ::Google::Cloud::RecommendationEngine::V1beta1::ProductEventDetail

**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::ProductEventDetail](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-ProductEventDetail)) ---

  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`

### #product_event_detail=

    def product_event_detail=(value) -> ::Google::Cloud::RecommendationEngine::V1beta1::ProductEventDetail

**Parameter**

- **value** ([::Google::Cloud::RecommendationEngine::V1beta1::ProductEventDetail](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-ProductEventDetail)) ---

  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`
**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::ProductEventDetail](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-ProductEventDetail)) ---

  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`

### #user_info

    def user_info() -> ::Google::Cloud::RecommendationEngine::V1beta1::UserInfo

**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::UserInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-UserInfo)) --- Required. User information.

### #user_info=

    def user_info=(value) -> ::Google::Cloud::RecommendationEngine::V1beta1::UserInfo

**Parameter**

- **value** ([::Google::Cloud::RecommendationEngine::V1beta1::UserInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-UserInfo)) --- Required. User information.
**Returns**

- ([::Google::Cloud::RecommendationEngine::V1beta1::UserInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-UserInfo)) --- Required. User information.