目录
此内容是否有帮助?

# 漏斗分析模型 API

调用方法请参见Open API文档中的调用方法描述。

可阅读使用手册中 漏斗分析 了解使用场景。

# 漏斗分析查询

接口URL

/open/funnel-analyze?token=xxx

请求方式

POST

Content-Type

application/json

请求Query参数

参数名 示例值 参数类型 是否必填 参数描述
token
xxx
String

查询密钥

# 请求Body参数

{
  "eventView":{
    "endTime":"2021-10-31 23:59:59",
    "filts":[
      {
        "columnDesc":"城市",
        "columnName":"city",
        "comparator":"equal",
        "filterType":"SIMPLE",
        "ftv":[
          "上海市",
          "北京市",
          "广州市",
          "深圳市"],
        "specifiedClusterDate":"2022-01-24",
        "tableType":"user",
        "timeUnit":""
      }],
    "groupBy":[
      {
        "columnDesc":"城市",
        "columnName":"city",
        "propertyRange":"",
        "specifiedClusterDate":"2022-01-24",
        "tableType":"user"
      }],
    "recentDay":"",
    "relation":"and",
    "startTime":"2021-10-01 00:00:00",
    "taIdMeasureVo":{
      "columnDesc":"用户唯一ID",
      "columnName":"#user_id",
      "tableType":"event"
    },
    "windows_gap":1,
    "windows_gap_tu":"hour"
  },
  "events":[
    {
      "eventName":"register",
      "eventNameDisplay":"",
      "filts":[
        {
          "columnDesc":"app版本",
          "columnName":"app_version",
          "comparator":"equal",
          "filterType":"SIMPLE",
          "ftv":[
            "V1.0"],
          "specifiedClusterDate":"2022-01-26",
          "tableType":"event",
          "timeUnit":""
        }],
      "relation":"and"
    },
    {
      "eventName":"login",
      "eventNameDisplay":"",
      "filts":[
      ],
      "relation":"and"
    },
    {
      "eventName":"activity_attend",
      "eventNameDisplay":"",
      "filts":[
      ],
      "relation":"and"
    },
    {
      "eventName":"logout",
      "eventNameDisplay":"",
      "filts":[
      ],
      "relation":"and"
    }
  ],
  "projectId":377,
  "limit": 2,
  "timeoutSeconds": 10,
  "useCache": true
}

# 请求参数说明

参数名 示例值 参数类型 是否必填 参数描述
eventView
-
Object

指标公共属性部分
endTime 2021-10-31 23:59:59
String

结束时间(格式:yyyy-MM-dd HH:mm:ss),相对时间为空时有效
filts -
List

全局筛选项
columnDesc 城市
String

字段显示名
columnName city
String

字段名
comparator equal
String

参考: 模型查询API的
筛选表达式
filterType SIMPLE
String

过滤模式,SIMPLE:简单,COMPOUND:复合
ftv ["上海市"]
List

用于属性比较边界的字面常量
specifiedClusterDate 2022-01-24
String

指定对应日期的标签历史版本
tableType user
String

表类型枚举值
timeUnit String

属性对比值单位,仅对relativeEvent*有效:day,hour,minute
groupBy -
List

分组属性,可以有零个或者多个
columnDesc 城市
String

字段显示名
columnName city
String

字段名
propertyRange String

自定义属性区间
specifiedClusterDate 2022-01-24
String

指定对应日期的标签历史版本
tableType user
String

表类型枚举值
recentDay String

相对时间(此项不可与起始时间和结束时间同时为空)
relation and
String

逻辑关系,and:逻辑与,or:逻辑或
startTime 2021-10-01 00:00:00
String

起始时间(格式:yyyy-MM-dd HH:mm:ss),相对时间为空时有效
taIdMeasureVo -
Object

分析主体配置
columnDesc 用户唯一ID
String

字段显示名
columnName #user_id
String

字段名
tableType event
String

表类型枚举值
windows_gap 1
Long

窗口时长
windows_gap_tu hour
String

窗口时长单位,
second:秒
minute:分钟
hour:小时
day:天
week:周
month:月
events
-
List

事件指标列表
eventName register
String

指标事件名称,可以使用 anyEvent 表示任意事件
eventNameDisplay String

自定义指标显示名
filts -
List

条件筛选列表
columnDesc app版本
String

字段显示名
columnName app_version
String

字段名称
comparator equal
String

参考: 模型查询API的
筛选表达式
filterType SIMPLE
String

过滤模式,SIMPLE:简单,COMPOUND:复合
ftv ["V1.0"]
List

用于属性比较边界的字面常量
specifiedClusterDate 2022-01-26
String

指定对应日期的标签历史版本
tableType event
String

表类型枚举值
timeUnit String

过滤时间单位
relation and
String

逻辑关系,and:逻辑与,or:逻辑或
projectId
377
Integer

项目ID
limit
2
Integer

每分析对象的分组数上限,可选参数,默认为1000,最大为10000
timeoutSeconds
10
Integer

请求超时参数,超时则取消查询任务
useCache
true
Boolean

使用缓存,可选参数,默认为true

# 成功响应示例

{
  "data": {
    "result_generate_time": "2022-01-26 19:23:51",
    "total": 5,
    "x": [
      "2021-10-01",
      "2021-10-02",
      "2021-10-03",
      "2021-10-04",
      "2021-10-05",
      "2021-10-06",
      "2021-10-07",
      "2021-10-08",
      "2021-10-09",
      "2021-10-10",
      "2021-10-11",
      "2021-10-12",
      "2021-10-13",
      "2021-10-14",
      "2021-10-15",
      "2021-10-16",
      "2021-10-17",
      "2021-10-18",
      "2021-10-19",
      "2021-10-20",
      "2021-10-21",
      "2021-10-22",
      "2021-10-23",
      "2021-10-24",
      "2021-10-25",
      "2021-10-26",
      "2021-10-27",
      "2021-10-28",
      "2021-10-29",
      "2021-10-30",
      "2021-10-31"
    ],
    "y": [
      {
        "总体": {
          "col1": [
            5666,
            197,
            197,
            197
          ],
          "col2": [
            [
              208,
              10,
              10,
              10
            ],
            [
              205,
              4,
              4,
              4
            ],
            [
              189,
              5,
              5,
              5
            ],
            [
              229,
              10,
              10,
              10
            ],
            [
              217,
              6,
              6,
              6
            ],
            [
              257,
              10,
              10,
              10
            ],
            [
              233,
              6,
              6,
              6
            ],
            [
              207,
              7,
              7,
              7
            ],
            [
              204,
              7,
              7,
              7
            ],
            [
              248,
              14,
              14,
              14
            ],
            [
              217,
              4,
              4,
              4
            ],
            [
              207,
              9,
              9,
              9
            ],
            [
              219,
              8,
              8,
              8
            ],
            [
              220,
              4,
              4,
              4
            ],
            [
              193,
              10,
              10,
              10
            ],
            [
              218,
              9,
              9,
              9
            ],
            [
              232,
              7,
              7,
              7
            ],
            [
              222,
              10,
              10,
              10
            ],
            [
              220,
              8,
              8,
              8
            ],
            [
              203,
              6,
              6,
              6
            ],
            [
              217,
              8,
              8,
              8
            ],
            [
              239,
              3,
              3,
              3
            ],
            [
              214,
              5,
              5,
              5
            ],
            [
              197,
              11,
              11,
              11
            ],
            [
              199,
              8,
              8,
              8
            ],
            [
              135,
              7,
              7,
              7
            ],
            [
              73,
              1,
              1,
              1
            ],
            [
              33,
              0,
              0,
              0
            ],
            [
              11,
              0,
              0,
              0
            ],
            [
              0,
              0,
              0,
              0
            ],
            [
              0,
              0,
              0,
              0
            ]
          ]
        }
      },
      {
        "北京市": {
          "col1": [
            2028,
            70,
            70,
            70
          ],
          "col2": [
            [
              79,
              1,
              1,
              1
            ],
            [
              71,
              2,
              2,
              2
            ],
            [
              65,
              0,
              0,
              0
            ],
            [
              74,
              3,
              3,
              3
            ],
            [
              72,
              2,
              2,
              2
            ],
            [
              89,
              3,
              3,
              3
            ],
            [
              88,
              2,
              2,
              2
            ],
            [
              75,
              3,
              3,
              3
            ],
            [
              66,
              4,
              4,
              4
            ],
            [
              95,
              1,
              1,
              1
            ],
            [
              60,
              1,
              1,
              1
            ],
            [
              68,
              5,
              5,
              5
            ],
            [
              80,
              5,
              5,
              5
            ],
            [
              68,
              2,
              2,
              2
            ],
            [
              67,
              6,
              6,
              6
            ],
            [
              84,
              4,
              4,
              4
            ],
            [
              84,
              1,
              1,
              1
            ],
            [
              87,
              1,
              1,
              1
            ],
            [
              79,
              6,
              6,
              6
            ],
            [
              76,
              1,
              1,
              1
            ],
            [
              81,
              3,
              3,
              3
            ],
            [
              85,
              1,
              1,
              1
            ],
            [
              89,
              2,
              2,
              2
            ],
            [
              75,
              3,
              3,
              3
            ],
            [
              74,
              5,
              5,
              5
            ],
            [
              49,
              2,
              2,
              2
            ],
            [
              26,
              1,
              1,
              1
            ],
            [
              16,
              0,
              0,
              0
            ],
            [
              6,
              0,
              0,
              0
            ],
            [
              0,
              0,
              0,
              0
            ],
            [
              0,
              0,
              0,
              0
            ]
          ]
        }
      }
    ],
    "z": [
      "register",
      "login",
      "activity_attend",
      "logout"
    ]
  },
  "return_code": 0,
  "return_message": "success"
}

# 响应参数说明

参数名 示例值 参数类型 参数描述
return_code
0
Integer
返回码
return_message
success
String
返回信息
data
-
Object
返回结果
result_generate_time 2022-01-01 00:00:00
String
计算结果生成时间
total 5
Integer
总数
x ["2021-10-01"]
List
时间列表
y -
List
数据列表
z ["register"]
List
事件名列表

错误响应示例

{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
参数名 示例值 参数类型 参数描述
return_code
-1008
Integer
返回码
return_message
参数(token)为空
String
返回信息

# 漏斗分析全量下载

接口URL

/open/streaming-download/funnel-analyze?token=xxx

请求方式

POST

Content-Type

application/json

请求Query参数

参数名 示例值 参数类型 是否必填 参数描述
token
xxx
String

查询密钥

# 请求Body参数

{
        "eventView": {
                "endTime": "2022-03-07 17:27:29",
                "filts": [],
                "groupBy": [],
                "recentDay": "1-7",
                "relation": "and",
                "startTime": "2022-03-01 17:27:29",
                "taIdMeasureVo": {
                        "columnDesc": "User ID",
                        "columnName": "#user_id",
                        "tableType": "event"
                },
                "windows_gap": 1,
                "windows_gap_tu": "day"
        },
        "events": [{
                "eventName": "Login",
                "eventNameDisplay": "",
                "filts": [],
                "relation": "and"
        }, {
                "eventName": "LogOut",
                "eventNameDisplay": "",
                "filts": [],
                "relation": "and"
        }],
        "projectId": 319,
        "timeView": "TOTAL_TIME",
        "resultType": "CONVERSION"
}

# 请求参数说明

参数名 示例值 参数类型 是否必填 参数描述
eventView
-
Object

参数内容与事件分析查询接口一致
events
-
List

参数内容与事件分析查询接口一致
projectId
377
Integer

项目ID
timeView
TOTAL_TIME
String

时间角度:
TOTAL_TIME(合计)
,
PER_DATE(按天)
resultType
CONVERSION
String

结果类型:CONVERSION(转换),
DROP_OFF(流失)

# 响应

同TE系统漏斗分析全量下载

# 漏斗分析用户列表

接口URL

/open/funnel-user-list?token=xxx

请求方式

POST

Content-Type

application/json

请求Query参数

参数名 示例值 参数类型 是否必填 参数描述
token
xxx
String

查询密钥
projectId
0
Integer

项目ID

# 请求Body参数

{
  "projectId": 0,
  "eventView": {
    "startTime": "2019-11-23 00:00:00",
    "endTime": "2019-11-26 00:00:00",
    "recentDay": "1-4",
    "relation": "and",
    "timeParticleSize": "day",
    "filts": [
      {
        "columnName": "user_level",
        "comparator": "equal",
        "ftv": [
          "5"
        ],
        "tableType": "user"
      }
    ],
    "groupBy": [
      {
        "columnName": "#province",
        "tableType": "event"
      }
    ]
  },
  "events": [
    {
      "eventName": "obtain_item",
      "relation": "and",
      "filts": [
        {
          "columnName": "#province",
          "comparator": "equal",
          "ftv": [
            "江苏省",
            "上海市"
          ],
          "tableType": "event"
        }
      ]
    }
  ],
  "sliceFunnelStep": 1,
  "sliceGroupVal": "['上海市']",
  "timeoutSeconds": 10
}

# 请求参数说明

参数名 示例值 参数类型 是否必填 参数描述
projectId
0
String

参数描述
eventView
-
Object

参数内容与漏斗分析查询接口一致
events
List

参数内容与漏斗分析查询接口一致
sliceFunnelStep
1
Integer

哪个漏斗步骤下钻, 从1开始
sliceGroupVal
"['上海市']"
List

哪个分组进行下钻
sliceWastageUser
false
Boolean

是否是流失的用户,true:是,false:否
timeoutSeconds
10
Integer

请求超时参数,超时则取消查询任务

# 成功响应示例

{
  "data": {
    "datalist": [
      {
        "#account_id": "u78082246",
        "#distinct_id": "u145009846",
        "user_level": 5,
        "register_time": "2019-11-26 09:59:34",
        "diamond_num": 1006,
        "latest_login_time": "2019-11-26 11:14:12",
        "channel": "小米应用商店",
        "#user_id": 33463846
      },
      {
        "#account_id": "k77655236",
        "#distinct_id": "k144216836",
        "user_level": 5,
        "register_time": "2019-11-24 08:53:09",
        "diamond_num": 1012,
        "latest_login_time": "2019-11-24 10:02:38",
        "channel": "豌豆荚",
        "#user_id": 33280836
      },
      {
        "#account_id": "a77648226",
        "#distinct_id": "a144203826",
        "user_level": 5,
        "register_time": "2019-11-24 08:21:19",
        "diamond_num": 1006,
        "latest_login_time": "2019-11-24 09:32:31",
        "channel": "应用宝",
        "#user_id": 33277826
      }
    ],
    "columMeta": {
      "#account_id": "账户ID",
      "#distinct_id": "访客ID",
      "user_level": "用户等级",
      "register_time": "注册时间",
      "diamond_num": "当前拥有钻石数",
      "first_recharge_time": "首次充值时间",
      "latest_login_time": "最后登录时间",
      "channel": "渠道"
    }
  },
  "return_code": 0,
  "return_message": "success"
}

# 响应参数说明

参数名 示例值 参数类型 参数描述
return_code
0
Integer
返回码
return_message
success
String
返回信息
data
-
Object
返回结果
datalist -
List
用户信息
columMeta -
Map
字段含义映射

错误响应示例

{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
参数名 示例值 参数类型 参数描述
return_code
-1008
Integer
返回码
return_message
参数(token)为空
String
返回信息

# 漏斗分析用户列表下载

接口URL

/open/streaming-download/funnel-user-list?token=xxx

请求方式

POST

Content-Type

application/json

请求Query参数

参数名 示例值 参数类型 是否必填 参数描述
token
xxx
String

查询密钥

# 请求Body参数

{
        "eventView": {
                "endTime": "2022-03-07 17:27:29",
                "filts": [],
                "groupBy": [],
                "recentDay": "1-7",
                "relation": "and",
                "startTime": "2022-03-01 17:27:29",
                "taIdMeasureVo": {
                        "columnDesc": "User ID",
                        "columnName": "#user_id",
                        "tableType": "event"
                },
                "windows_gap": 1,
                "windows_gap_tu": "day"
        },
        "events": [{
                "eventName": "Login",
                "eventNameDisplay": "",
                "filts": [],
                "relation": "and"
        }, {
                "eventName": "LogOut",
                "eventNameDisplay": "",
                "filts": [],
                "relation": "and"
        }],
        "projectId": 319,
        "sliceFunnelStep": 1,
        "sliceWastageUser": false,
        "selectedColumns": ["#account_id", "#distinct_id"]
}

# 请求参数说明

参数名 示例值 参数类型 是否必填 参数描述
projectId
0
String

参数描述
eventView
-
Object

参数内容与漏斗分析查询接口一致
events
List

参数内容与漏斗分析查询接口一致
sliceFunnelStep
1
Integer

哪个漏斗步骤下钻, 从1开始
sliceGroupVal
"['上海市']"
List

哪个分组进行下钻
sliceWastageUser
false
Boolean

是否是流失的用户,true:是,false:否
selectedColumns
["#account_id", "#distinct_id"]
Array

下载的列

# 响应

同TE系统漏斗分析用户列表下载