You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Amplitude REST API(分段)实现按事件名过滤分组统计

解决Amplitude Dashboard REST API事件过滤与分组的参数配置问题

你遇到的问题核心是混淆了界面显示名称和API实际使用的字段名,Amplitude界面上的"Event Name"在API中对应的字段是event_type,而非字面的"Event Name"。以下是修正后的请求配置:

方案一:直接指定事件类型数组(更简洁)

{
  "event_type": ["event1", "event2"],
  "group_by": [
    {
      "type": "event_type",
      "value": "event_type"
    }
  ]
}

方案二:使用filters过滤(适用于更复杂的过滤逻辑)

{
  "event_type": "_all",
  "filters": [
    {
      "prop_type": "event_type",
      "prop_op": "is",
      "prop_value": ["event1", "event2"]
    }
  ],
  "group_by": [
    {
      "type": "event_type",
      "value": "event_type"
    }
  ]
}

关键修正点:

  • 过滤事件名时:无需使用subprop_type(该字段用于事件的自定义子属性),直接通过prop_type: "event_type"匹配顶层的事件类型字段,同时用prop_value指定目标事件列表。
  • 按事件名分组时:group_by的type和value都需设为event_type,对应API中事件类型的分组逻辑,而非界面显示的"Event Name"。

内容的提问来源于stack exchange,提问作者yulGM

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 05:12:39