pv_uv_main.md 6.61 KB

#流量分析首页接口

接口描述

1、流量总览分析

请求参数

Param Name Param Type Required Param Value Desc
type String false pc/ios/android/wap/all 客户端类类型(默认all)
appEdition String true 客户端版本:AB
date date false 2016-12-26 时间类型(默认当天)

请求方法

 get   htttp://localhost:8080/flowsurvey/overview?type=all&date=2016-12-26&appEdition=A

响应内容json

{
"code": 200,
 "msg": "",
"data": {
"type": "all",
"date": "2016-12-16",
"content": {
  "pv": "",
  "uv": "",
  "loss_rate": "",
  "avg_pv": "",
  "avg_stay": ""
}
}
}

2、流量趋势分析(现在默认近7天的数据)

请求参数

Param Name Param Type Required Param Value Desc
type String false pc/wap/ios/android/all 客户端类类型(默认全部)
appEdition String true 客户端版本:AB
index String false pv,uv,loss_rate,avg_pv,avg_stay] 指标类型(默认全部指标)

请求方法

get  http://localhost:8080/flowsurvey/trend?type=al&index=pv,uv&appEdition=A

响应内容json

{
"code": 200,
"msg": "",
"data": {
"type": "pc",
"content": [
  {
    "date": "2016-12-26",
    "pv": "",
    "uv": "",
    "loss_rate": "",
    "avg_pv": "",
    "avg_stay": ""
  },
  {
    "date": "2016-12-25",
    "pv": "",
    "uv": "",
    "loss_rate": "",
    "avg_pv": "",
    "avg_stay": ""
  },
  {
    "date": "2016-12-24",
    "pv": "",
    "uv": "",
    "loss_rate": "",
    "avg_pv": "",
    "avg_stay": ""
  }
]
}
}

3、来源排行分析

请求参数

Param Name Param Type Required Param Value Desc
type String true ios/android 客户端类类型
appEdition String true 客户端版本:AB
date date false 2016-12-26 时间类型(默认当天)

请求方法

 get   htttp://localhost:8080/flowsurvey/resource_rank?type=ios&date=2016-12-26&appEdition=A

响应内容json(结果已排序 index 从大到小排列)

   {
 "code": 200,
 "msg": "",
"data": {
"type": "ios",
"date": "2016-12-26",
"content": [
  {
    "index": 1,
    "name": "自然流量",
    "uv": 1,
    "order_rate": "12",
    "order_rate_change": "+- 6"
  },
  {
    "index": 2,
    "name": "搜索流量",
    "uv": 1,
    "order_rate": "12",
    "order_rate_change": "+- 6"
  }
]
}
}

4、访客行为分析

请求参数

Param Name Param Type Required Param Value Desc
type String true brand/product 排行分类
appEdition String true 客户端版本:AB
date date false 2016-12-26 时间类型(默认当天)
top Int false 排名多少(默认前50)

请求方法

 get   htttp://localhost:8080/flowsurvey/action_rank?type=brand&date=2016-12-26&top=50&appEdition=A

响应内容json (同上 index 排序)

{
"code": 200,
 "msg": "",
 "data": {
"type": "brand",
"date": "2016-12-26",
"content": [
  {
    "index": "1",
    "name": "vans",
    "uv": 7000,
    "order_rate": "12"
  },
  {
    "index": 2,
    "name": "adidas",
    "uv": 6000,
    "order_rate": "8"
  }
]
 }
}

5、用户特征分析

请求参数

Param Name Param Type Required Param Value Desc
type String true terminal/city/gender/comp 特征类型
appEdition String true 客户端版本:AB
date date false 2016-12-26 时间类型(默认当天)

请求方法

 get   htttp://localhost:8080/flowsurvey/user_rank?type=terminal&date=2016-12-26&appEdition=A


#### 响应内容json
##### terminal

{
"code": 200,
"msg": "",
"data": {
    "type": "terminal",
    "date": "2016-12-26",
    "content": {
        "pc": [
            {
                "time": 0,
                "uv": 1
            },
            {
                "time": 1,
                "uv": 1
            }
        ],
        "wireless": [
            {
                "time": 0,
                "uv": 1
            },
            {
                "time": 1,
                "uv": 1
            }
        ]
    }
}
}



##### city

{
"code": 200,
"msg": "",
"data": {
"type": "city",
"date": "2016-12-26",
"content": [
  {
    "index": 1,
    "name": "上海",
    "uv": 1,
    "order_rate": "5"
  },
  {
    "index": 2,
    "name": "北京",
    "uv": 1,
    "order_rate": "5"
  }
]
}
}


##### gender

{
 "code": 200,
 "msg": "",
 "data": {
"type": "gender",
"date": "2016-12-26",
"content": [
  {
    "index": 1,
    "name": "男生",
    "uv": 1,
    "order_rate": "5"
  },
  {
    "index": 2,
    "name": "女生",
    "uv": 1,
    "order_rate": "5"
  },
  {
    "index": 3,
    "name": "其它",
    "uv": 1,
    "order_rate": "5"
  }
]
}
}


##### comp  组成

{
"code": 200,
"msg": "",
"data": {
    "type": "comp",
    "date": "2016-12-26",
    "content": {
        "user": [
            {
                "name": "新客",
                "uv": 1,
                "order_rate": "5"
            },
            {
                "name": "老客",
                "uv": 1,
                "order_rate": "95"
            }
        ],
        "terminal": [
            {
                "name": "pc",
                "uv": 1,
                "order_rate": "5"
            },
            {
                "name": "无线",
                "uv": 1,
                "order_rate": "95"
            }
        ]
    }
  }
}