1.0.17 • Published 10 months ago

asp-smart-collection v1.0.17

Weekly downloads
2
License
MIT
Repository
-
Last release
10 months ago

使用方式

  • 第一步 安装依赖 cnpm i asp-smart-collection -S
  • 第二部 在 main.js 中引入
  • 引入 import { Track } from 'asp-smart-collection'
  • 注册挂载 Vue.prototype.$Track = Track
  • 初始化 this.$Track.init(config) 初始化需要传配置参数
    • init 方法 参数说明 类型 Object {}
    • url 字段类型 String 说明:请求 url 用户向后端提交收集到的信息 【必须】
    • userInfo 字段类型 Object 说明:用户信息 【非必须】
    • isTrackOnly 字段类型 Bool 说明:设置为 true 时,只支持有痕埋点 aspTrackEvent(event, data)
    • aspRequest 字段类型 function 说明:用于提交给后台收集到的信息的 API 【非必须】url, data

组件上报给后端服务器的参数说明如下:

无痕 PV 参数-事件点击行为

  • { host, hashPath, fullPath, trackPath, userInfo, createTime, eventType, trackingType }
    • host 字段类型 String 说明:域名地址 ip+端口 eg: http://localhost:10001/
    • hashPath 字段类型 String 说明:页面地址带 hash 不带路由参数 eg:http://localhost:10001/#/login
    • fullPath 字段类型 String 说明:页面的完整地址 带路由参数 eg: http://localhost:10001/#/login?id=233
    • trackPath 字段类型 String 说明:事件轨迹 UV 事件时为空
      • 1、如果标签中有定义标识 如:点击, 此时 trackPath 的值就是“点击按钮 ID”
      • 2、如果没有定义标识,但 dom 元素中有描述 如 点击 此时 trackPath 的值就是“div>button>span>点击”
      • 3、没有标识 也没有描述 如: 则返回标签轨迹 此时 trackPath 的值就是 “div>button>span”
    • createTime 字段类型 String 说明:事件触发时间 yyyy-mm-dd hh:mm:ss 年月日 时分秒
    • userInfo 字段类型 Object 说明:用户信息 由外部传入
    • eventType 字段类型 String 说明:事件类型 如:click
    • trackingType 字段类型 String 说明:数据收集类型 "1"为无痕 "2"为有痕
    • offsetX 字段类型 String 说明:点击页面时的 x 坐标
    • offsetY 字段类型 String 说明:y 坐标

无痕 PV 参数-页面跳转行为

-- { host, fullPath, hashPath, userInfo, createTime, trackPath ,userInfo, fromPath}

  • fromPath 字段类型 String 说明:进入当前页面的前一个页面的完整地址 eg:http://localhost:10001/#/home
  • host 字段类型 String 说明:域名地址 ip+端口 eg: http://localhost:10001/
  • hashPath 字段类型 String 说明:页面地址带 hash 不带路由参数 eg:http://localhost:10001/#/login
  • fullPath 字段类型 String 说明:页面的完整地址 带路由参数 eg: http://localhost:10001/#/login?id=233
  • trackPath 字段类型 String 说明:事件轨迹 UV 事件时为空
  • createTime 字段类型 String 说明:事件触发时间 yyyy-mm-dd hh:mm:ss 年月日 时分秒
  • userInfo 字段类型 Object 说明:用户信息 由外部传入
  • eventType 字段类型 String 说明:事件类型 如:click
  • trackingType 字段类型 String 说明:数据收集类型 "1"为无痕 "2"为有痕

用户 UV 行为需要后台根据上传的数据自行过滤

有痕埋点 在代码中植入 aspTrackEvent(event, data)

  • 包含无痕 PV 的所有信息 在此基础上 增加用户自定义的参数 data
  • event 说明:事件触发时的 event 信息
  • data 说明:用户自定义的信息 字段类型 Object

  • 用法 this.$smartCollection.aspTrackEvent(event, data)

  • 例如在 vue 页面总绑定点击事件 <el-button @click="(event) => { handleClick(event, '测试点击') }">点击

  •     handleClick (event, i) {
  •        const data = { test: '2342' }
  •        this.$smartCollection.aspTrackEvent(event, data)
  •    },

外部 API

aspSetOtherInfo(otherInfo) 补充设置埋点需要收集的额外信息

  • 参数说明 otherInfo 字段类型 Object 数据收集的额外补充信息
  • 用法 this.$smartCollection.aspSetOtherInfo(otherInfo)
1.0.17

10 months ago

1.0.16

10 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

2 years ago

1.0.11

2 years ago

1.0.12

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.10

2 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago