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.
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.
[[["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-06-27 UTC."],[[["\u003cp\u003eThis page documents the \u003ccode\u003euserEvents:collect\u003c/code\u003e method, which uses a GET request for browser-based user event tracking within the Discovery Engine API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003euserEvents:collect\u003c/code\u003e method is specifically designed for internal use by the Discovery Engine API JavaScript pixel and Google Tag Manager, not for direct user calls.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request structure is \u003ccode\u003eGET https://discoveryengine.googleapis.com/v1/{parent=projects/*/locations/*}/userEvents:collect\u003c/code\u003e, leveraging gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eKey parameters include the \u003ccode\u003eparent\u003c/code\u003e path parameter, specifying the resource location, and query parameters like \u003ccode\u003euserEvent\u003c/code\u003e, \u003ccode\u003euri\u003c/code\u003e, and \u003ccode\u003eets\u003c/code\u003e for event data and timestamp.\u003c/p\u003e\n"],["\u003cp\u003eThe method requires an empty request body and needs the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.userEvents.collect\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nWrites 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.\n\nThis method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.\n\n### HTTP request\n\n`GET https://discoveryengine.googleapis.com/v1/{parent=projects/*/locations/*}/userEvents:collect`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Query parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response is a generic HTTP response whose format is defined by the method.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]