Method: projects.locations.userEvents.collect
Stay organized with collections
Save and categorize content based on your preferences.
Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain.
This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.
HTTP request
GET https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*}/userEvents:collect
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
parent |
string
Required. The parent resource name. If the collect user event action is applied in DataStore level, the format is: projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore} . If the collect user event action is applied in Location level, for example, the event with Document across multiple DataStore , the format is: projects/{project}/locations/{location} .
|
Query parameters
Parameters |
userEvent |
string
Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.
|
uri |
string
The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for third-party requests.
|
ets |
string (int64 format)
The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.
|
Request body
The request body must be empty.
Response body
If successful, the response is a generic HTTP response whose format is defined by the method.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-03 UTC."],[[["This API endpoint uses a GET request to write a single user event from the browser, specifically designed for the Discovery Engine API JavaScript pixel and Google Tag Manager."],["The HTTP request is structured as `GET https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*}/userEvents:collect` utilizing gRPC Transcoding syntax."],["The `parent` path parameter, is required and is used to define the resource, the `DataStore` level format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`, and the `Location` level format is `projects/{project}/locations/{location}`."],["The required query parameter `userEvent` must be a URL encoded UserEvent proto, with a character limit of 2,000,000, and other important query parameters include `uri` and `ets`."],["The authorization scope required for this API is `https://www.googleapis.com/auth/cloud-platform`."]]],[]]