- 0.49.0 (latest)
- 0.48.0
- 0.47.0
- 0.45.0
- 0.44.0
- 0.43.0
- 0.42.0
- 0.41.0
- 0.40.0
- 0.39.0
- 0.38.0
- 0.37.0
- 0.36.0
- 0.35.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
public static final class UserEvent.Builder extends GeneratedMessageV3.Builder<UserEvent.Builder> implements UserEventOrBuilder
UserEvent captures all metadata information DiscoveryEngine API needs to know about how end users interact with customers' website.
Protobuf type google.cloud.discoveryengine.v1beta.UserEvent
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > UserEvent.BuilderImplements
UserEventOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Type | Description |
Descriptor |
Methods
addAllDocuments(Iterable<? extends DocumentInfo> values)
public UserEvent.Builder addAllDocuments(Iterable<? extends DocumentInfo> values)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
values | Iterable<? extends com.google.cloud.discoveryengine.v1beta.DocumentInfo> |
Type | Description |
UserEvent.Builder |
addAllPromotionIds(Iterable<String> values)
public UserEvent.Builder addAllPromotionIds(Iterable<String> values)
The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
Name | Description |
values | Iterable<String> The promotionIds to add. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
addAllTagIds(Iterable<String> values)
public UserEvent.Builder addAllTagIds(Iterable<String> values)
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 on the customer end.
repeated string tag_ids = 15;
Name | Description |
values | Iterable<String> The tagIds to add. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
addDocuments(DocumentInfo value)
public UserEvent.Builder addDocuments(DocumentInfo value)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
value | DocumentInfo |
Type | Description |
UserEvent.Builder |
addDocuments(DocumentInfo.Builder builderForValue)
public UserEvent.Builder addDocuments(DocumentInfo.Builder builderForValue)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
builderForValue | DocumentInfo.Builder |
Type | Description |
UserEvent.Builder |
addDocuments(int index, DocumentInfo value)
public UserEvent.Builder addDocuments(int index, DocumentInfo value)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
index | int |
value | DocumentInfo |
Type | Description |
UserEvent.Builder |
addDocuments(int index, DocumentInfo.Builder builderForValue)
public UserEvent.Builder addDocuments(int index, DocumentInfo.Builder builderForValue)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
index | int |
builderForValue | DocumentInfo.Builder |
Type | Description |
UserEvent.Builder |
addDocumentsBuilder()
public DocumentInfo.Builder addDocumentsBuilder()
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Type | Description |
DocumentInfo.Builder |
addDocumentsBuilder(int index)
public DocumentInfo.Builder addDocumentsBuilder(int index)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
index | int |
Type | Description |
DocumentInfo.Builder |
addPromotionIds(String value)
public UserEvent.Builder addPromotionIds(String value)
The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
Name | Description |
value | String The promotionIds to add. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
addPromotionIdsBytes(ByteString value)
public UserEvent.Builder addPromotionIdsBytes(ByteString value)
The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
Name | Description |
value | ByteString The bytes of the promotionIds to add. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public UserEvent.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
UserEvent.Builder |
addTagIds(String value)
public UserEvent.Builder addTagIds(String value)
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 on the customer end.
repeated string tag_ids = 15;
Name | Description |
value | String The tagIds to add. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
addTagIdsBytes(ByteString value)
public UserEvent.Builder addTagIdsBytes(ByteString value)
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 on the customer end.
repeated string tag_ids = 15;
Name | Description |
value | ByteString The bytes of the tagIds to add. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
build()
public UserEvent build()
Type | Description |
UserEvent |
buildPartial()
public UserEvent buildPartial()
Type | Description |
UserEvent |
clear()
public UserEvent.Builder clear()
Type | Description |
UserEvent.Builder |
clearAttributes()
public UserEvent.Builder clearAttributes()
Type | Description |
UserEvent.Builder |
clearAttributionToken()
public UserEvent.Builder clearAttributionToken()
Token to attribute an API response to user action(s) to trigger the event. Highly recommended for user events that are the result of [PredictionService.Predict][]. This field enables accurate attribution of recommendation model performance. The value must be one of:
- [PredictResponse.attribution_token][] for events that are the result of [PredictionService.Predict][].
- SearchResponse.attribution_token for events that are the result of [SearchService.Search][].
- [CompleteQueryResponse.attribution_token][] for events that are the result of [SearchService.CompleteQuery][]. This token enables us to accurately attribute page view or conversion completion back to the event and the particular predict response containing this clicked/purchased product. If user clicks on product K in the recommendation results, pass [PredictResponse.attribution_token][] as a URL parameter to product K's page. When recording events on product K's page, log the [PredictResponse.attribution_token][] to this field.
string attribution_token = 8;
Type | Description |
UserEvent.Builder | This builder for chaining. |
clearCompletionInfo()
public UserEvent.Builder clearCompletionInfo()
CompleteQuery API details related to the event.
This field should be set for search
event when autocomplete function is
enabled and the user clicks a suggestion for search.
.google.cloud.discoveryengine.v1beta.CompletionInfo completion_info = 13;
Type | Description |
UserEvent.Builder |
clearDirectUserRequest()
public UserEvent.Builder clearDirectUserRequest()
Should set to true if the request is made directly from the end user, in which case the UserEvent.user_info.user_agent can be populated from the HTTP request. 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). This should not be set when using the JavaScript tag in UserEventService.CollectUserEvent.
bool direct_user_request = 5;
Type | Description |
UserEvent.Builder | This builder for chaining. |
clearDocuments()
public UserEvent.Builder clearDocuments()
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Type | Description |
UserEvent.Builder |
clearEventTime()
public UserEvent.Builder clearEventTime()
Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
.google.protobuf.Timestamp event_time = 3;
Type | Description |
UserEvent.Builder |
clearEventType()
public UserEvent.Builder clearEventType()
Required. User event type. Allowed values are: Generic values:
search
: Search for Documents.view-item
: Detailed page view of a Document.view-item-list
: View of a panel or ordered list of Documents.view-home-page
: View of the home page.view-category-page
: View of a category page, e.g. Home > Men > Jeans Retail-related values:add-to-cart
: Add an item(s) to cart, e.g. in Retail online shoppingpurchase
: Purchase an item(s) Media-related values:media-play
: Start/resume watching a video, playing a song, etc.media-complete
: Finished or stopped midway through a video, song, etc.
string event_type = 1 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
UserEvent.Builder | This builder for chaining. |
clearField(Descriptors.FieldDescriptor field)
public UserEvent.Builder clearField(Descriptors.FieldDescriptor field)
Name | Description |
field | FieldDescriptor |
Type | Description |
UserEvent.Builder |
clearFilter()
public UserEvent.Builder clearFilter()
The filter syntax consists of an expression language for constructing a
predicate from one or more fields of the documents being filtered.
One example is for search
events, the associated
[SearchService.SearchRequest][] may contain a filter expression in
[SearchService.SearchRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
Similarly, for view-item-list
events that are generated from a
[PredictionService.PredictRequest][], this field may be populated directly
from [PredictionService.PredictRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
The value must be a UTF-8 encoded string with a length limit of 1,000
characters. Otherwise, an INVALID_ARGUMENT error is returned.
string filter = 9;
Type | Description |
UserEvent.Builder | This builder for chaining. |
clearMediaInfo()
public UserEvent.Builder clearMediaInfo()
Media-specific info.
.google.cloud.discoveryengine.v1beta.MediaInfo media_info = 18;
Type | Description |
UserEvent.Builder |
clearOneof(Descriptors.OneofDescriptor oneof)
public UserEvent.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Name | Description |
oneof | OneofDescriptor |
Type | Description |
UserEvent.Builder |
clearPageInfo()
public UserEvent.Builder clearPageInfo()
Page metadata such as categories and other critical information for certain
event types such as view-category-page
.
.google.cloud.discoveryengine.v1beta.PageInfo page_info = 7;
Type | Description |
UserEvent.Builder |
clearPanel()
public UserEvent.Builder clearPanel()
Panel metadata associated with this user event.
.google.cloud.discoveryengine.v1beta.PanelInfo panel = 11;
Type | Description |
UserEvent.Builder |
clearPromotionIds()
public UserEvent.Builder clearPromotionIds()
The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
Type | Description |
UserEvent.Builder | This builder for chaining. |
clearSearchInfo()
public UserEvent.Builder clearSearchInfo()
Search API details related to the event.
This field should be set for search
event.
.google.cloud.discoveryengine.v1beta.SearchInfo search_info = 12;
Type | Description |
UserEvent.Builder |
clearSessionId()
public UserEvent.Builder clearSessionId()
A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session is an aggregation of an end user behavior in a time span. A general guideline to populate the sesion_id:
- If user has no activity for 30 min, a new session_id should be assigned.
- The session_id should be unique across users, suggest use uuid or add UserEvent.user_pseudo_id as prefix.
string session_id = 6;
Type | Description |
UserEvent.Builder | This builder for chaining. |
clearTagIds()
public UserEvent.Builder clearTagIds()
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 on the customer end.
repeated string tag_ids = 15;
Type | Description |
UserEvent.Builder | This builder for chaining. |
clearTransactionInfo()
public UserEvent.Builder clearTransactionInfo()
The transaction metadata (if any) associated with this user event.
.google.cloud.discoveryengine.v1beta.TransactionInfo transaction_info = 14;
Type | Description |
UserEvent.Builder |
clearUserInfo()
public UserEvent.Builder clearUserInfo()
Information about the end user.
.google.cloud.discoveryengine.v1beta.UserInfo user_info = 4;
Type | Description |
UserEvent.Builder |
clearUserPseudoId()
public UserEvent.Builder clearUserPseudoId()
Required. A unique identifier for tracking visitors. 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 log in/out of the website. Do not 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. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. The field should not contain PII or user-data. We recommend to use Google Analytics Client ID for this field.
string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
UserEvent.Builder | This builder for chaining. |
clone()
public UserEvent.Builder clone()
Type | Description |
UserEvent.Builder |
containsAttributes(String key)
public boolean containsAttributes(String key)
Extra user event features to include in the recommendation model. These attributes must NOT contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you provide custom attributes for ingested user events, also include them in the user events that you associate with prediction requests. Custom attribute formatting must be consistent between imported events and events provided with prediction requests. This lets the DiscoveryEngine API use those custom attributes when training models and serving predictions, which helps improve recommendation quality. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
- The key must be a UTF-8 encoded string with a length limit of 5,000 characters.
- For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed. For product recommendations, an example of extra user information is traffic_channel, which is how a user arrives at the site. Users can arrive at the site by coming to the site directly, coming through Google search, or in other ways.
map<string, .google.cloud.discoveryengine.v1beta.CustomAttribute> attributes = 17;
Name | Description |
key | String |
Type | Description |
boolean |
getAttributes()
public Map<String,CustomAttribute> getAttributes()
Use #getAttributesMap() instead.
Type | Description |
Map<String,CustomAttribute> |
getAttributesCount()
public int getAttributesCount()
Extra user event features to include in the recommendation model. These attributes must NOT contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you provide custom attributes for ingested user events, also include them in the user events that you associate with prediction requests. Custom attribute formatting must be consistent between imported events and events provided with prediction requests. This lets the DiscoveryEngine API use those custom attributes when training models and serving predictions, which helps improve recommendation quality. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
- The key must be a UTF-8 encoded string with a length limit of 5,000 characters.
- For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed. For product recommendations, an example of extra user information is traffic_channel, which is how a user arrives at the site. Users can arrive at the site by coming to the site directly, coming through Google search, or in other ways.
map<string, .google.cloud.discoveryengine.v1beta.CustomAttribute> attributes = 17;
Type | Description |
int |
getAttributesMap()
public Map<String,CustomAttribute> getAttributesMap()
Extra user event features to include in the recommendation model. These attributes must NOT contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you provide custom attributes for ingested user events, also include them in the user events that you associate with prediction requests. Custom attribute formatting must be consistent between imported events and events provided with prediction requests. This lets the DiscoveryEngine API use those custom attributes when training models and serving predictions, which helps improve recommendation quality. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
- The key must be a UTF-8 encoded string with a length limit of 5,000 characters.
- For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed. For product recommendations, an example of extra user information is traffic_channel, which is how a user arrives at the site. Users can arrive at the site by coming to the site directly, coming through Google search, or in other ways.
map<string, .google.cloud.discoveryengine.v1beta.CustomAttribute> attributes = 17;
Type | Description |
Map<String,CustomAttribute> |
getAttributesOrDefault(String key, CustomAttribute defaultValue)
public CustomAttribute getAttributesOrDefault(String key, CustomAttribute defaultValue)
Extra user event features to include in the recommendation model. These attributes must NOT contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you provide custom attributes for ingested user events, also include them in the user events that you associate with prediction requests. Custom attribute formatting must be consistent between imported events and events provided with prediction requests. This lets the DiscoveryEngine API use those custom attributes when training models and serving predictions, which helps improve recommendation quality. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
- The key must be a UTF-8 encoded string with a length limit of 5,000 characters.
- For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed. For product recommendations, an example of extra user information is traffic_channel, which is how a user arrives at the site. Users can arrive at the site by coming to the site directly, coming through Google search, or in other ways.
map<string, .google.cloud.discoveryengine.v1beta.CustomAttribute> attributes = 17;
Name | Description |
key | String |
defaultValue | CustomAttribute |
Type | Description |
CustomAttribute |
getAttributesOrThrow(String key)
public CustomAttribute getAttributesOrThrow(String key)
Extra user event features to include in the recommendation model. These attributes must NOT contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you provide custom attributes for ingested user events, also include them in the user events that you associate with prediction requests. Custom attribute formatting must be consistent between imported events and events provided with prediction requests. This lets the DiscoveryEngine API use those custom attributes when training models and serving predictions, which helps improve recommendation quality. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
- The key must be a UTF-8 encoded string with a length limit of 5,000 characters.
- For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed. For product recommendations, an example of extra user information is traffic_channel, which is how a user arrives at the site. Users can arrive at the site by coming to the site directly, coming through Google search, or in other ways.
map<string, .google.cloud.discoveryengine.v1beta.CustomAttribute> attributes = 17;
Name | Description |
key | String |
Type | Description |
CustomAttribute |
getAttributionToken()
public String getAttributionToken()
Token to attribute an API response to user action(s) to trigger the event. Highly recommended for user events that are the result of [PredictionService.Predict][]. This field enables accurate attribution of recommendation model performance. The value must be one of:
- [PredictResponse.attribution_token][] for events that are the result of [PredictionService.Predict][].
- SearchResponse.attribution_token for events that are the result of [SearchService.Search][].
- [CompleteQueryResponse.attribution_token][] for events that are the result of [SearchService.CompleteQuery][]. This token enables us to accurately attribute page view or conversion completion back to the event and the particular predict response containing this clicked/purchased product. If user clicks on product K in the recommendation results, pass [PredictResponse.attribution_token][] as a URL parameter to product K's page. When recording events on product K's page, log the [PredictResponse.attribution_token][] to this field.
string attribution_token = 8;
Type | Description |
String | The attributionToken. |
getAttributionTokenBytes()
public ByteString getAttributionTokenBytes()
Token to attribute an API response to user action(s) to trigger the event. Highly recommended for user events that are the result of [PredictionService.Predict][]. This field enables accurate attribution of recommendation model performance. The value must be one of:
- [PredictResponse.attribution_token][] for events that are the result of [PredictionService.Predict][].
- SearchResponse.attribution_token for events that are the result of [SearchService.Search][].
- [CompleteQueryResponse.attribution_token][] for events that are the result of [SearchService.CompleteQuery][]. This token enables us to accurately attribute page view or conversion completion back to the event and the particular predict response containing this clicked/purchased product. If user clicks on product K in the recommendation results, pass [PredictResponse.attribution_token][] as a URL parameter to product K's page. When recording events on product K's page, log the [PredictResponse.attribution_token][] to this field.
string attribution_token = 8;
Type | Description |
ByteString | The bytes for attributionToken. |
getCompletionInfo()
public CompletionInfo getCompletionInfo()
CompleteQuery API details related to the event.
This field should be set for search
event when autocomplete function is
enabled and the user clicks a suggestion for search.
.google.cloud.discoveryengine.v1beta.CompletionInfo completion_info = 13;
Type | Description |
CompletionInfo | The completionInfo. |
getCompletionInfoBuilder()
public CompletionInfo.Builder getCompletionInfoBuilder()
CompleteQuery API details related to the event.
This field should be set for search
event when autocomplete function is
enabled and the user clicks a suggestion for search.
.google.cloud.discoveryengine.v1beta.CompletionInfo completion_info = 13;
Type | Description |
CompletionInfo.Builder |
getCompletionInfoOrBuilder()
public CompletionInfoOrBuilder getCompletionInfoOrBuilder()
CompleteQuery API details related to the event.
This field should be set for search
event when autocomplete function is
enabled and the user clicks a suggestion for search.
.google.cloud.discoveryengine.v1beta.CompletionInfo completion_info = 13;
Type | Description |
CompletionInfoOrBuilder |
getDefaultInstanceForType()
public UserEvent getDefaultInstanceForType()
Type | Description |
UserEvent |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Type | Description |
Descriptor |
getDirectUserRequest()
public boolean getDirectUserRequest()
Should set to true if the request is made directly from the end user, in which case the UserEvent.user_info.user_agent can be populated from the HTTP request. 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). This should not be set when using the JavaScript tag in UserEventService.CollectUserEvent.
bool direct_user_request = 5;
Type | Description |
boolean | The directUserRequest. |
getDocuments(int index)
public DocumentInfo getDocuments(int index)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
index | int |
Type | Description |
DocumentInfo |
getDocumentsBuilder(int index)
public DocumentInfo.Builder getDocumentsBuilder(int index)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
index | int |
Type | Description |
DocumentInfo.Builder |
getDocumentsBuilderList()
public List<DocumentInfo.Builder> getDocumentsBuilderList()
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Type | Description |
List<Builder> |
getDocumentsCount()
public int getDocumentsCount()
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Type | Description |
int |
getDocumentsList()
public List<DocumentInfo> getDocumentsList()
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Type | Description |
List<DocumentInfo> |
getDocumentsOrBuilder(int index)
public DocumentInfoOrBuilder getDocumentsOrBuilder(int index)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
index | int |
Type | Description |
DocumentInfoOrBuilder |
getDocumentsOrBuilderList()
public List<? extends DocumentInfoOrBuilder> getDocumentsOrBuilderList()
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Type | Description |
List<? extends com.google.cloud.discoveryengine.v1beta.DocumentInfoOrBuilder> |
getEventTime()
public Timestamp getEventTime()
Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
.google.protobuf.Timestamp event_time = 3;
Type | Description |
Timestamp | The eventTime. |
getEventTimeBuilder()
public Timestamp.Builder getEventTimeBuilder()
Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
.google.protobuf.Timestamp event_time = 3;
Type | Description |
Builder |
getEventTimeOrBuilder()
public TimestampOrBuilder getEventTimeOrBuilder()
Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
.google.protobuf.Timestamp event_time = 3;
Type | Description |
TimestampOrBuilder |
getEventType()
public String getEventType()
Required. User event type. Allowed values are: Generic values:
search
: Search for Documents.view-item
: Detailed page view of a Document.view-item-list
: View of a panel or ordered list of Documents.view-home-page
: View of the home page.view-category-page
: View of a category page, e.g. Home > Men > Jeans Retail-related values:add-to-cart
: Add an item(s) to cart, e.g. in Retail online shoppingpurchase
: Purchase an item(s) Media-related values:media-play
: Start/resume watching a video, playing a song, etc.media-complete
: Finished or stopped midway through a video, song, etc.
string event_type = 1 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
String | The eventType. |
getEventTypeBytes()
public ByteString getEventTypeBytes()
Required. User event type. Allowed values are: Generic values:
search
: Search for Documents.view-item
: Detailed page view of a Document.view-item-list
: View of a panel or ordered list of Documents.view-home-page
: View of the home page.view-category-page
: View of a category page, e.g. Home > Men > Jeans Retail-related values:add-to-cart
: Add an item(s) to cart, e.g. in Retail online shoppingpurchase
: Purchase an item(s) Media-related values:media-play
: Start/resume watching a video, playing a song, etc.media-complete
: Finished or stopped midway through a video, song, etc.
string event_type = 1 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
ByteString | The bytes for eventType. |
getFilter()
public String getFilter()
The filter syntax consists of an expression language for constructing a
predicate from one or more fields of the documents being filtered.
One example is for search
events, the associated
[SearchService.SearchRequest][] may contain a filter expression in
[SearchService.SearchRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
Similarly, for view-item-list
events that are generated from a
[PredictionService.PredictRequest][], this field may be populated directly
from [PredictionService.PredictRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
The value must be a UTF-8 encoded string with a length limit of 1,000
characters. Otherwise, an INVALID_ARGUMENT error is returned.
string filter = 9;
Type | Description |
String | The filter. |
getFilterBytes()
public ByteString getFilterBytes()
The filter syntax consists of an expression language for constructing a
predicate from one or more fields of the documents being filtered.
One example is for search
events, the associated
[SearchService.SearchRequest][] may contain a filter expression in
[SearchService.SearchRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
Similarly, for view-item-list
events that are generated from a
[PredictionService.PredictRequest][], this field may be populated directly
from [PredictionService.PredictRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
The value must be a UTF-8 encoded string with a length limit of 1,000
characters. Otherwise, an INVALID_ARGUMENT error is returned.
string filter = 9;
Type | Description |
ByteString | The bytes for filter. |
getMediaInfo()
public MediaInfo getMediaInfo()
Media-specific info.
.google.cloud.discoveryengine.v1beta.MediaInfo media_info = 18;
Type | Description |
MediaInfo | The mediaInfo. |
getMediaInfoBuilder()
public MediaInfo.Builder getMediaInfoBuilder()
Media-specific info.
.google.cloud.discoveryengine.v1beta.MediaInfo media_info = 18;
Type | Description |
MediaInfo.Builder |
getMediaInfoOrBuilder()
public MediaInfoOrBuilder getMediaInfoOrBuilder()
Media-specific info.
.google.cloud.discoveryengine.v1beta.MediaInfo media_info = 18;
Type | Description |
MediaInfoOrBuilder |
getMutableAttributes()
public Map<String,CustomAttribute> getMutableAttributes()
Use alternate mutation accessors instead.
Type | Description |
Map<String,CustomAttribute> |
getPageInfo()
public PageInfo getPageInfo()
Page metadata such as categories and other critical information for certain
event types such as view-category-page
.
.google.cloud.discoveryengine.v1beta.PageInfo page_info = 7;
Type | Description |
PageInfo | The pageInfo. |
getPageInfoBuilder()
public PageInfo.Builder getPageInfoBuilder()
Page metadata such as categories and other critical information for certain
event types such as view-category-page
.
.google.cloud.discoveryengine.v1beta.PageInfo page_info = 7;
Type | Description |
PageInfo.Builder |
getPageInfoOrBuilder()
public PageInfoOrBuilder getPageInfoOrBuilder()
Page metadata such as categories and other critical information for certain
event types such as view-category-page
.
.google.cloud.discoveryengine.v1beta.PageInfo page_info = 7;
Type | Description |
PageInfoOrBuilder |
getPanel()
public PanelInfo getPanel()
Panel metadata associated with this user event.
.google.cloud.discoveryengine.v1beta.PanelInfo panel = 11;
Type | Description |
PanelInfo | The panel. |
getPanelBuilder()
public PanelInfo.Builder getPanelBuilder()
Panel metadata associated with this user event.
.google.cloud.discoveryengine.v1beta.PanelInfo panel = 11;
Type | Description |
PanelInfo.Builder |
getPanelOrBuilder()
public PanelInfoOrBuilder getPanelOrBuilder()
Panel metadata associated with this user event.
.google.cloud.discoveryengine.v1beta.PanelInfo panel = 11;
Type | Description |
PanelInfoOrBuilder |
getPromotionIds(int index)
public String getPromotionIds(int index)
The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The promotionIds at the given index. |
getPromotionIdsBytes(int index)
public ByteString getPromotionIdsBytes(int index)
The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the promotionIds at the given index. |
getPromotionIdsCount()
public int getPromotionIdsCount()
The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
Type | Description |
int | The count of promotionIds. |
getPromotionIdsList()
public ProtocolStringList getPromotionIdsList()
The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
Type | Description |
ProtocolStringList | A list containing the promotionIds. |
getSearchInfo()
public SearchInfo getSearchInfo()
Search API details related to the event.
This field should be set for search
event.
.google.cloud.discoveryengine.v1beta.SearchInfo search_info = 12;
Type | Description |
SearchInfo | The searchInfo. |
getSearchInfoBuilder()
public SearchInfo.Builder getSearchInfoBuilder()
Search API details related to the event.
This field should be set for search
event.
.google.cloud.discoveryengine.v1beta.SearchInfo search_info = 12;
Type | Description |
SearchInfo.Builder |
getSearchInfoOrBuilder()
public SearchInfoOrBuilder getSearchInfoOrBuilder()
Search API details related to the event.
This field should be set for search
event.
.google.cloud.discoveryengine.v1beta.SearchInfo search_info = 12;
Type | Description |
SearchInfoOrBuilder |
getSessionId()
public String getSessionId()
A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session is an aggregation of an end user behavior in a time span. A general guideline to populate the sesion_id:
- If user has no activity for 30 min, a new session_id should be assigned.
- The session_id should be unique across users, suggest use uuid or add UserEvent.user_pseudo_id as prefix.
string session_id = 6;
Type | Description |
String | The sessionId. |
getSessionIdBytes()
public ByteString getSessionIdBytes()
A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session is an aggregation of an end user behavior in a time span. A general guideline to populate the sesion_id:
- If user has no activity for 30 min, a new session_id should be assigned.
- The session_id should be unique across users, suggest use uuid or add UserEvent.user_pseudo_id as prefix.
string session_id = 6;
Type | Description |
ByteString | The bytes for sessionId. |
getTagIds(int index)
public String getTagIds(int index)
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 on the customer end.
repeated string tag_ids = 15;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The tagIds at the given index. |
getTagIdsBytes(int index)
public ByteString getTagIdsBytes(int index)
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 on the customer end.
repeated string tag_ids = 15;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the tagIds at the given index. |
getTagIdsCount()
public int getTagIdsCount()
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 on the customer end.
repeated string tag_ids = 15;
Type | Description |
int | The count of tagIds. |
getTagIdsList()
public ProtocolStringList getTagIdsList()
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 on the customer end.
repeated string tag_ids = 15;
Type | Description |
ProtocolStringList | A list containing the tagIds. |
getTransactionInfo()
public TransactionInfo getTransactionInfo()
The transaction metadata (if any) associated with this user event.
.google.cloud.discoveryengine.v1beta.TransactionInfo transaction_info = 14;
Type | Description |
TransactionInfo | The transactionInfo. |
getTransactionInfoBuilder()
public TransactionInfo.Builder getTransactionInfoBuilder()
The transaction metadata (if any) associated with this user event.
.google.cloud.discoveryengine.v1beta.TransactionInfo transaction_info = 14;
Type | Description |
TransactionInfo.Builder |
getTransactionInfoOrBuilder()
public TransactionInfoOrBuilder getTransactionInfoOrBuilder()
The transaction metadata (if any) associated with this user event.
.google.cloud.discoveryengine.v1beta.TransactionInfo transaction_info = 14;
Type | Description |
TransactionInfoOrBuilder |
getUserInfo()
public UserInfo getUserInfo()
Information about the end user.
.google.cloud.discoveryengine.v1beta.UserInfo user_info = 4;
Type | Description |
UserInfo | The userInfo. |
getUserInfoBuilder()
public UserInfo.Builder getUserInfoBuilder()
Information about the end user.
.google.cloud.discoveryengine.v1beta.UserInfo user_info = 4;
Type | Description |
UserInfo.Builder |
getUserInfoOrBuilder()
public UserInfoOrBuilder getUserInfoOrBuilder()
Information about the end user.
.google.cloud.discoveryengine.v1beta.UserInfo user_info = 4;
Type | Description |
UserInfoOrBuilder |
getUserPseudoId()
public String getUserPseudoId()
Required. A unique identifier for tracking visitors. 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 log in/out of the website. Do not 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. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. The field should not contain PII or user-data. We recommend to use Google Analytics Client ID for this field.
string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
String | The userPseudoId. |
getUserPseudoIdBytes()
public ByteString getUserPseudoIdBytes()
Required. A unique identifier for tracking visitors. 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 log in/out of the website. Do not 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. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. The field should not contain PII or user-data. We recommend to use Google Analytics Client ID for this field.
string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED];
Type | Description |
ByteString | The bytes for userPseudoId. |
hasCompletionInfo()
public boolean hasCompletionInfo()
CompleteQuery API details related to the event.
This field should be set for search
event when autocomplete function is
enabled and the user clicks a suggestion for search.
.google.cloud.discoveryengine.v1beta.CompletionInfo completion_info = 13;
Type | Description |
boolean | Whether the completionInfo field is set. |
hasEventTime()
public boolean hasEventTime()
Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
.google.protobuf.Timestamp event_time = 3;
Type | Description |
boolean | Whether the eventTime field is set. |
hasMediaInfo()
public boolean hasMediaInfo()
Media-specific info.
.google.cloud.discoveryengine.v1beta.MediaInfo media_info = 18;
Type | Description |
boolean | Whether the mediaInfo field is set. |
hasPageInfo()
public boolean hasPageInfo()
Page metadata such as categories and other critical information for certain
event types such as view-category-page
.
.google.cloud.discoveryengine.v1beta.PageInfo page_info = 7;
Type | Description |
boolean | Whether the pageInfo field is set. |
hasPanel()
public boolean hasPanel()
Panel metadata associated with this user event.
.google.cloud.discoveryengine.v1beta.PanelInfo panel = 11;
Type | Description |
boolean | Whether the panel field is set. |
hasSearchInfo()
public boolean hasSearchInfo()
Search API details related to the event.
This field should be set for search
event.
.google.cloud.discoveryengine.v1beta.SearchInfo search_info = 12;
Type | Description |
boolean | Whether the searchInfo field is set. |
hasTransactionInfo()
public boolean hasTransactionInfo()
The transaction metadata (if any) associated with this user event.
.google.cloud.discoveryengine.v1beta.TransactionInfo transaction_info = 14;
Type | Description |
boolean | Whether the transactionInfo field is set. |
hasUserInfo()
public boolean hasUserInfo()
Information about the end user.
.google.cloud.discoveryengine.v1beta.UserInfo user_info = 4;
Type | Description |
boolean | Whether the userInfo field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Type | Description |
FieldAccessorTable |
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Name | Description |
number | int |
Type | Description |
MapField |
internalGetMutableMapField(int number)
protected MapField internalGetMutableMapField(int number)
Name | Description |
number | int |
Type | Description |
MapField |
isInitialized()
public final boolean isInitialized()
Type | Description |
boolean |
mergeCompletionInfo(CompletionInfo value)
public UserEvent.Builder mergeCompletionInfo(CompletionInfo value)
CompleteQuery API details related to the event.
This field should be set for search
event when autocomplete function is
enabled and the user clicks a suggestion for search.
.google.cloud.discoveryengine.v1beta.CompletionInfo completion_info = 13;
Name | Description |
value | CompletionInfo |
Type | Description |
UserEvent.Builder |
mergeEventTime(Timestamp value)
public UserEvent.Builder mergeEventTime(Timestamp value)
Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
.google.protobuf.Timestamp event_time = 3;
Name | Description |
value | Timestamp |
Type | Description |
UserEvent.Builder |
mergeFrom(UserEvent other)
public UserEvent.Builder mergeFrom(UserEvent other)
Name | Description |
other | UserEvent |
Type | Description |
UserEvent.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public UserEvent.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
UserEvent.Builder |
Type | Description |
IOException |
mergeFrom(Message other)
public UserEvent.Builder mergeFrom(Message other)
Name | Description |
other | Message |
Type | Description |
UserEvent.Builder |
mergeMediaInfo(MediaInfo value)
public UserEvent.Builder mergeMediaInfo(MediaInfo value)
Media-specific info.
.google.cloud.discoveryengine.v1beta.MediaInfo media_info = 18;
Name | Description |
value | MediaInfo |
Type | Description |
UserEvent.Builder |
mergePageInfo(PageInfo value)
public UserEvent.Builder mergePageInfo(PageInfo value)
Page metadata such as categories and other critical information for certain
event types such as view-category-page
.
.google.cloud.discoveryengine.v1beta.PageInfo page_info = 7;
Name | Description |
value | PageInfo |
Type | Description |
UserEvent.Builder |
mergePanel(PanelInfo value)
public UserEvent.Builder mergePanel(PanelInfo value)
Panel metadata associated with this user event.
.google.cloud.discoveryengine.v1beta.PanelInfo panel = 11;
Name | Description |
value | PanelInfo |
Type | Description |
UserEvent.Builder |
mergeSearchInfo(SearchInfo value)
public UserEvent.Builder mergeSearchInfo(SearchInfo value)
Search API details related to the event.
This field should be set for search
event.
.google.cloud.discoveryengine.v1beta.SearchInfo search_info = 12;
Name | Description |
value | SearchInfo |
Type | Description |
UserEvent.Builder |
mergeTransactionInfo(TransactionInfo value)
public UserEvent.Builder mergeTransactionInfo(TransactionInfo value)
The transaction metadata (if any) associated with this user event.
.google.cloud.discoveryengine.v1beta.TransactionInfo transaction_info = 14;
Name | Description |
value | TransactionInfo |
Type | Description |
UserEvent.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final UserEvent.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
UserEvent.Builder |
mergeUserInfo(UserInfo value)
public UserEvent.Builder mergeUserInfo(UserInfo value)
Information about the end user.
.google.cloud.discoveryengine.v1beta.UserInfo user_info = 4;
Name | Description |
value | UserInfo |
Type | Description |
UserEvent.Builder |
putAllAttributes(Map<String,CustomAttribute> values)
public UserEvent.Builder putAllAttributes(Map<String,CustomAttribute> values)
Extra user event features to include in the recommendation model. These attributes must NOT contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you provide custom attributes for ingested user events, also include them in the user events that you associate with prediction requests. Custom attribute formatting must be consistent between imported events and events provided with prediction requests. This lets the DiscoveryEngine API use those custom attributes when training models and serving predictions, which helps improve recommendation quality. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
- The key must be a UTF-8 encoded string with a length limit of 5,000 characters.
- For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed. For product recommendations, an example of extra user information is traffic_channel, which is how a user arrives at the site. Users can arrive at the site by coming to the site directly, coming through Google search, or in other ways.
map<string, .google.cloud.discoveryengine.v1beta.CustomAttribute> attributes = 17;
Name | Description |
values | Map<String,CustomAttribute> |
Type | Description |
UserEvent.Builder |
putAttributes(String key, CustomAttribute value)
public UserEvent.Builder putAttributes(String key, CustomAttribute value)
Extra user event features to include in the recommendation model. These attributes must NOT contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you provide custom attributes for ingested user events, also include them in the user events that you associate with prediction requests. Custom attribute formatting must be consistent between imported events and events provided with prediction requests. This lets the DiscoveryEngine API use those custom attributes when training models and serving predictions, which helps improve recommendation quality. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
- The key must be a UTF-8 encoded string with a length limit of 5,000 characters.
- For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed. For product recommendations, an example of extra user information is traffic_channel, which is how a user arrives at the site. Users can arrive at the site by coming to the site directly, coming through Google search, or in other ways.
map<string, .google.cloud.discoveryengine.v1beta.CustomAttribute> attributes = 17;
Name | Description |
key | String |
value | CustomAttribute |
Type | Description |
UserEvent.Builder |
removeAttributes(String key)
public UserEvent.Builder removeAttributes(String key)
Extra user event features to include in the recommendation model. These attributes must NOT contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you provide custom attributes for ingested user events, also include them in the user events that you associate with prediction requests. Custom attribute formatting must be consistent between imported events and events provided with prediction requests. This lets the DiscoveryEngine API use those custom attributes when training models and serving predictions, which helps improve recommendation quality. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
- The key must be a UTF-8 encoded string with a length limit of 5,000 characters.
- For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters.
- For number attributes, at most 400 values are allowed. For product recommendations, an example of extra user information is traffic_channel, which is how a user arrives at the site. Users can arrive at the site by coming to the site directly, coming through Google search, or in other ways.
map<string, .google.cloud.discoveryengine.v1beta.CustomAttribute> attributes = 17;
Name | Description |
key | String |
Type | Description |
UserEvent.Builder |
removeDocuments(int index)
public UserEvent.Builder removeDocuments(int index)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
index | int |
Type | Description |
UserEvent.Builder |
setAttributionToken(String value)
public UserEvent.Builder setAttributionToken(String value)
Token to attribute an API response to user action(s) to trigger the event. Highly recommended for user events that are the result of [PredictionService.Predict][]. This field enables accurate attribution of recommendation model performance. The value must be one of:
- [PredictResponse.attribution_token][] for events that are the result of [PredictionService.Predict][].
- SearchResponse.attribution_token for events that are the result of [SearchService.Search][].
- [CompleteQueryResponse.attribution_token][] for events that are the result of [SearchService.CompleteQuery][]. This token enables us to accurately attribute page view or conversion completion back to the event and the particular predict response containing this clicked/purchased product. If user clicks on product K in the recommendation results, pass [PredictResponse.attribution_token][] as a URL parameter to product K's page. When recording events on product K's page, log the [PredictResponse.attribution_token][] to this field.
string attribution_token = 8;
Name | Description |
value | String The attributionToken to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setAttributionTokenBytes(ByteString value)
public UserEvent.Builder setAttributionTokenBytes(ByteString value)
Token to attribute an API response to user action(s) to trigger the event. Highly recommended for user events that are the result of [PredictionService.Predict][]. This field enables accurate attribution of recommendation model performance. The value must be one of:
- [PredictResponse.attribution_token][] for events that are the result of [PredictionService.Predict][].
- SearchResponse.attribution_token for events that are the result of [SearchService.Search][].
- [CompleteQueryResponse.attribution_token][] for events that are the result of [SearchService.CompleteQuery][]. This token enables us to accurately attribute page view or conversion completion back to the event and the particular predict response containing this clicked/purchased product. If user clicks on product K in the recommendation results, pass [PredictResponse.attribution_token][] as a URL parameter to product K's page. When recording events on product K's page, log the [PredictResponse.attribution_token][] to this field.
string attribution_token = 8;
Name | Description |
value | ByteString The bytes for attributionToken to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setCompletionInfo(CompletionInfo value)
public UserEvent.Builder setCompletionInfo(CompletionInfo value)
CompleteQuery API details related to the event.
This field should be set for search
event when autocomplete function is
enabled and the user clicks a suggestion for search.
.google.cloud.discoveryengine.v1beta.CompletionInfo completion_info = 13;
Name | Description |
value | CompletionInfo |
Type | Description |
UserEvent.Builder |
setCompletionInfo(CompletionInfo.Builder builderForValue)
public UserEvent.Builder setCompletionInfo(CompletionInfo.Builder builderForValue)
CompleteQuery API details related to the event.
This field should be set for search
event when autocomplete function is
enabled and the user clicks a suggestion for search.
.google.cloud.discoveryengine.v1beta.CompletionInfo completion_info = 13;
Name | Description |
builderForValue | CompletionInfo.Builder |
Type | Description |
UserEvent.Builder |
setDirectUserRequest(boolean value)
public UserEvent.Builder setDirectUserRequest(boolean value)
Should set to true if the request is made directly from the end user, in which case the UserEvent.user_info.user_agent can be populated from the HTTP request. 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). This should not be set when using the JavaScript tag in UserEventService.CollectUserEvent.
bool direct_user_request = 5;
Name | Description |
value | boolean The directUserRequest to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setDocuments(int index, DocumentInfo value)
public UserEvent.Builder setDocuments(int index, DocumentInfo value)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
index | int |
value | DocumentInfo |
Type | Description |
UserEvent.Builder |
setDocuments(int index, DocumentInfo.Builder builderForValue)
public UserEvent.Builder setDocuments(int index, DocumentInfo.Builder builderForValue)
List of Documents associated with this user event. This field is optional except for the following event types:
view-item
add-to-cart
purchase
media-play
media-complete
In asearch
event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a newsearch
event with different UserEvent.documents is desired.
repeated .google.cloud.discoveryengine.v1beta.DocumentInfo documents = 10;
Name | Description |
index | int |
builderForValue | DocumentInfo.Builder |
Type | Description |
UserEvent.Builder |
setEventTime(Timestamp value)
public UserEvent.Builder setEventTime(Timestamp value)
Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
.google.protobuf.Timestamp event_time = 3;
Name | Description |
value | Timestamp |
Type | Description |
UserEvent.Builder |
setEventTime(Timestamp.Builder builderForValue)
public UserEvent.Builder setEventTime(Timestamp.Builder builderForValue)
Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
.google.protobuf.Timestamp event_time = 3;
Name | Description |
builderForValue | Builder |
Type | Description |
UserEvent.Builder |
setEventType(String value)
public UserEvent.Builder setEventType(String value)
Required. User event type. Allowed values are: Generic values:
search
: Search for Documents.view-item
: Detailed page view of a Document.view-item-list
: View of a panel or ordered list of Documents.view-home-page
: View of the home page.view-category-page
: View of a category page, e.g. Home > Men > Jeans Retail-related values:add-to-cart
: Add an item(s) to cart, e.g. in Retail online shoppingpurchase
: Purchase an item(s) Media-related values:media-play
: Start/resume watching a video, playing a song, etc.media-complete
: Finished or stopped midway through a video, song, etc.
string event_type = 1 [(.google.api.field_behavior) = REQUIRED];
Name | Description |
value | String The eventType to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setEventTypeBytes(ByteString value)
public UserEvent.Builder setEventTypeBytes(ByteString value)
Required. User event type. Allowed values are: Generic values:
search
: Search for Documents.view-item
: Detailed page view of a Document.view-item-list
: View of a panel or ordered list of Documents.view-home-page
: View of the home page.view-category-page
: View of a category page, e.g. Home > Men > Jeans Retail-related values:add-to-cart
: Add an item(s) to cart, e.g. in Retail online shoppingpurchase
: Purchase an item(s) Media-related values:media-play
: Start/resume watching a video, playing a song, etc.media-complete
: Finished or stopped midway through a video, song, etc.
string event_type = 1 [(.google.api.field_behavior) = REQUIRED];
Name | Description |
value | ByteString The bytes for eventType to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setField(Descriptors.FieldDescriptor field, Object value)
public UserEvent.Builder setField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
UserEvent.Builder |
setFilter(String value)
public UserEvent.Builder setFilter(String value)
The filter syntax consists of an expression language for constructing a
predicate from one or more fields of the documents being filtered.
One example is for search
events, the associated
[SearchService.SearchRequest][] may contain a filter expression in
[SearchService.SearchRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
Similarly, for view-item-list
events that are generated from a
[PredictionService.PredictRequest][], this field may be populated directly
from [PredictionService.PredictRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
The value must be a UTF-8 encoded string with a length limit of 1,000
characters. Otherwise, an INVALID_ARGUMENT error is returned.
string filter = 9;
Name | Description |
value | String The filter to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setFilterBytes(ByteString value)
public UserEvent.Builder setFilterBytes(ByteString value)
The filter syntax consists of an expression language for constructing a
predicate from one or more fields of the documents being filtered.
One example is for search
events, the associated
[SearchService.SearchRequest][] may contain a filter expression in
[SearchService.SearchRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
Similarly, for view-item-list
events that are generated from a
[PredictionService.PredictRequest][], this field may be populated directly
from [PredictionService.PredictRequest.filter][] conforming to
https://google.aip.dev/160#filtering.
The value must be a UTF-8 encoded string with a length limit of 1,000
characters. Otherwise, an INVALID_ARGUMENT error is returned.
string filter = 9;
Name | Description |
value | ByteString The bytes for filter to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setMediaInfo(MediaInfo value)
public UserEvent.Builder setMediaInfo(MediaInfo value)
Media-specific info.
.google.cloud.discoveryengine.v1beta.MediaInfo media_info = 18;
Name | Description |
value | MediaInfo |
Type | Description |
UserEvent.Builder |
setMediaInfo(MediaInfo.Builder builderForValue)
public UserEvent.Builder setMediaInfo(MediaInfo.Builder builderForValue)
Media-specific info.
.google.cloud.discoveryengine.v1beta.MediaInfo media_info = 18;
Name | Description |
builderForValue | MediaInfo.Builder |
Type | Description |
UserEvent.Builder |
setPageInfo(PageInfo value)
public UserEvent.Builder setPageInfo(PageInfo value)
Page metadata such as categories and other critical information for certain
event types such as view-category-page
.
.google.cloud.discoveryengine.v1beta.PageInfo page_info = 7;
Name | Description |
value | PageInfo |
Type | Description |
UserEvent.Builder |
setPageInfo(PageInfo.Builder builderForValue)
public UserEvent.Builder setPageInfo(PageInfo.Builder builderForValue)
Page metadata such as categories and other critical information for certain
event types such as view-category-page
.
.google.cloud.discoveryengine.v1beta.PageInfo page_info = 7;
Name | Description |
builderForValue | PageInfo.Builder |
Type | Description |
UserEvent.Builder |
setPanel(PanelInfo value)
public UserEvent.Builder setPanel(PanelInfo value)
Panel metadata associated with this user event.
.google.cloud.discoveryengine.v1beta.PanelInfo panel = 11;
Name | Description |
value | PanelInfo |
Type | Description |
UserEvent.Builder |
setPanel(PanelInfo.Builder builderForValue)
public UserEvent.Builder setPanel(PanelInfo.Builder builderForValue)
Panel metadata associated with this user event.
.google.cloud.discoveryengine.v1beta.PanelInfo panel = 11;
Name | Description |
builderForValue | PanelInfo.Builder |
Type | Description |
UserEvent.Builder |
setPromotionIds(int index, String value)
public UserEvent.Builder setPromotionIds(int index, String value)
The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
Name | Description |
index | int The index to set the value at. |
value | String The promotionIds to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public UserEvent.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Name | Description |
field | FieldDescriptor |
index | int |
value | Object |
Type | Description |
UserEvent.Builder |
setSearchInfo(SearchInfo value)
public UserEvent.Builder setSearchInfo(SearchInfo value)
Search API details related to the event.
This field should be set for search
event.
.google.cloud.discoveryengine.v1beta.SearchInfo search_info = 12;
Name | Description |
value | SearchInfo |
Type | Description |
UserEvent.Builder |
setSearchInfo(SearchInfo.Builder builderForValue)
public UserEvent.Builder setSearchInfo(SearchInfo.Builder builderForValue)
Search API details related to the event.
This field should be set for search
event.
.google.cloud.discoveryengine.v1beta.SearchInfo search_info = 12;
Name | Description |
builderForValue | SearchInfo.Builder |
Type | Description |
UserEvent.Builder |
setSessionId(String value)
public UserEvent.Builder setSessionId(String value)
A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session is an aggregation of an end user behavior in a time span. A general guideline to populate the sesion_id:
- If user has no activity for 30 min, a new session_id should be assigned.
- The session_id should be unique across users, suggest use uuid or add UserEvent.user_pseudo_id as prefix.
string session_id = 6;
Name | Description |
value | String The sessionId to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setSessionIdBytes(ByteString value)
public UserEvent.Builder setSessionIdBytes(ByteString value)
A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session is an aggregation of an end user behavior in a time span. A general guideline to populate the sesion_id:
- If user has no activity for 30 min, a new session_id should be assigned.
- The session_id should be unique across users, suggest use uuid or add UserEvent.user_pseudo_id as prefix.
string session_id = 6;
Name | Description |
value | ByteString The bytes for sessionId to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setTagIds(int index, String value)
public UserEvent.Builder setTagIds(int index, String value)
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 on the customer end.
repeated string tag_ids = 15;
Name | Description |
index | int The index to set the value at. |
value | String The tagIds to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setTransactionInfo(TransactionInfo value)
public UserEvent.Builder setTransactionInfo(TransactionInfo value)
The transaction metadata (if any) associated with this user event.
.google.cloud.discoveryengine.v1beta.TransactionInfo transaction_info = 14;
Name | Description |
value | TransactionInfo |
Type | Description |
UserEvent.Builder |
setTransactionInfo(TransactionInfo.Builder builderForValue)
public UserEvent.Builder setTransactionInfo(TransactionInfo.Builder builderForValue)
The transaction metadata (if any) associated with this user event.
.google.cloud.discoveryengine.v1beta.TransactionInfo transaction_info = 14;
Name | Description |
builderForValue | TransactionInfo.Builder |
Type | Description |
UserEvent.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final UserEvent.Builder setUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
UserEvent.Builder |
setUserInfo(UserInfo value)
public UserEvent.Builder setUserInfo(UserInfo value)
Information about the end user.
.google.cloud.discoveryengine.v1beta.UserInfo user_info = 4;
Name | Description |
value | UserInfo |
Type | Description |
UserEvent.Builder |
setUserInfo(UserInfo.Builder builderForValue)
public UserEvent.Builder setUserInfo(UserInfo.Builder builderForValue)
Information about the end user.
.google.cloud.discoveryengine.v1beta.UserInfo user_info = 4;
Name | Description |
builderForValue | UserInfo.Builder |
Type | Description |
UserEvent.Builder |
setUserPseudoId(String value)
public UserEvent.Builder setUserPseudoId(String value)
Required. A unique identifier for tracking visitors. 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 log in/out of the website. Do not 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. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. The field should not contain PII or user-data. We recommend to use Google Analytics Client ID for this field.
string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED];
Name | Description |
value | String The userPseudoId to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |
setUserPseudoIdBytes(ByteString value)
public UserEvent.Builder setUserPseudoIdBytes(ByteString value)
Required. A unique identifier for tracking visitors. 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 log in/out of the website. Do not 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. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. The field should not contain PII or user-data. We recommend to use Google Analytics Client ID for this field.
string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED];
Name | Description |
value | ByteString The bytes for userPseudoId to set. |
Type | Description |
UserEvent.Builder | This builder for chaining. |