1.4.4 • Published 1 year ago

vue-auto-track v1.4.4

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

环境依赖

uniapp vue2.0

部署步骤

  1. npm install vue-auto-track

  2. import track from 'vue-auto-track'(main.js)

  3. Vue.use(track, { env: 'xx', upload: Promise, size: xxx, constData: Object, pageConfig:Object })

目录结构描述

├├── index.js
└── untils
    ├── env.js
    ├── exposure.js      //监控组件或者页面元素曝光
    ├── get-upload.js    //收集+上传
    ├── global.js        //全局常量
    ├── lifecycle.js     //小程序生命周期
    ├── native.js        //基础数据采集
    ├── temp.js
    └── tools.js         //js方法库

options

optiontypevaluesdes
envStringrequire'wx' 或'h5'
uploadPromiserequire返回结果为 Promise 对象的请求方法
sizeNumberrequire触发上传数据大小
constDataObjectcustom每个埋点事件触发携带的基础常量如: ip,版本,平台等
dyDataObjectcustom每个埋点事件触发携带的动态变量: 各类唯一 id
pageConfigObjectcustom页面配置项如: 曝光的节点元素
Vue.use(track, {
  env: "wx",
  upload: (data) => request("https://xxxxx.xxxxx.xxxxx/eReport", { data }),
  size: 10000,
  constData: {
    app_cd: "jixuan",
    platform: "wx_h5",
    client_version: "吉选平台V3.1.0",
  },
  pageConfig,
  dyData() {
    return {};
  },
  plugins: [
    (eventId, data) => uma.trackEvent(eventId), //eventId可以通过data加工
  ],
});

pageConfig

optiontypevaluesdes
selectorsPgArrayrequire页面级元素曝光
selectorsCpArrayrequire组件级元素曝光
nameStringrequire页面级元素曝光
routeStringrequire组件级元素曝光
export const homePage = {
  //监控曝光
  selectorsPg: [
    {
      selector: ".back-top",
      multipule: false,
    },
  ],
  selectorsCp: [
    {
      selector: ".goods__wrapper",
      multipule: false,
    },
  ],
  name: "首页",
  route: "pages/tabs/index/index",
};
1.3.7

1 year ago

1.3.6

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.9

2 years ago

1.2.0

3 years ago

1.2.8

2 years ago

1.1.9

3 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.9

3 years ago

1.0.8

3 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