Method: projects.locations.userEvents.collect

从浏览器写入单个用户事件。由于浏览器限制向第三方网域发送 POST 请求,因此这里使用 GET 请求。

此方法仅供 Discovery Engine API JavaScript Pixel 和 Google 跟踪代码管理器使用。用户不应直接调用此方法。

HTTP 请求

GET https://discoveryengine.googleapis.com/v1beta/{parent=projects/*/locations/*}/userEvents:collect

网址采用 gRPC 转码语法。

路径参数

参数
parent

string

必需。父级资源名称。如果收集用户事件操作应用于 DataStore 级别,则格式为:projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}。如果收集用户事件操作应用于 Location 级,例如,具有 Document 的事件跨多个 DataStore,则格式为:projects/{project}/locations/{location}

查询参数

参数
userEvent

string

必需。网址编码的 UserEvent proto,长度上限为 2,000,000 个字符。

uri

string

网址(包括 CGI 参数,但不包括哈希片段),长度上限为 5,000 个字符。这通常比引荐来源网址更有用,因为许多浏览器仅针对第三方请求发送网域。

ets

string (int64 format)

事件时间戳(以毫秒为单位)。这样可以防止浏览器缓存其他方面相同的 GET 请求。名称已缩写,以减少载荷字节数。

请求正文

请求正文必须为空。

响应正文

如果成功,则响应为通用 HTTP 响应,其格式由方法定义。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.assist.readwrite

如需了解详情,请参阅 Authentication Overview