路径转化

优质
小牛编辑
132浏览
2023-12-01

功能介绍

获取路径转化漏斗的漏斗图和转化图数据。

接口

https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey

请求参数

此处仅列本接口特有参数,公共参数请参考报告级API说明

获取表格数据

参数名参数类型是否必须描述
methodstringconversion/pathconversion/a;conversion/pathconversion/f
typestring可选值为: funnel-> 漏斗报告, trend->趋势报告
conversionIdint该转化漏斗的id
metricsstring指标列表,指标间逗号分隔
eventIdint当请求type为trend, method为conversion/pathconversion/f时,加入此参数请求单个级别的转化率趋势
natureint自然日:1,自然周:2,自然月:3

此报告所请求的时间会按照nature的值自动调整到适合的自然日、自然周、自然月

指标

指标名描述适用接口
conversion_user_count转化用户数conversion/pathconversion/a
conversion_session_count事件次数conversion/pathconversion/a
conversion_ratio转化率conversion/pathconversion/a,conversion/pathconversion/f

示例

获取路径转化的漏斗图数据

请求

https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey?access_token=[ACCESS_TOKEN]&key=[APP_KEY]&method=conversion/pathconversion/f&start-date=20170101000000&end-date=20170101232359&metrics=conversion_ratio&nature=1&conversionId=333&type=funnel

响应

{
    "status": 0,
    "msg": "",
    "data": {
        "offset": 0,
        "timeSpan": [
            "2017\/11\/07"
        ],
        "fields": [
            "conversion_step_title",
            "conversion_user_count",
            "conversion_ratio"
        ],
        "total": 3,
        "end": 0,
        "sum": [
            [
                0,
                0
            ],
            []
        ],
        "pageSum": [],
        "items": [
            [
                [
                    {
                        "id": "379395",
                        "label": "选车"
                    }
                ],
                [
                    {
                        "id": "333410",
                        "label": "车辆详情"
                    }
                ],
                [
                    {
                        "id": 312752,
                        "label": "支付押金"
                    }
                ]
            ],
            [
                [
                    771,
                    100
                ],
                [
                    3,
                    0.39
                ],
                [
                    0,
                    0
                ]
            ],
            [],
            []
        ]
    }
}