vortex-trackjs

1.4.1 • Public • Published

前端埋点工具,可用于步骤流程、事件、接口数据的采集。

安装

# 安装 vortex-trackjs
npm install vortex-trackjs --save

配置使用

在main.js里面引入,并完成初始化

// main.js 中配置
import Track from 'vortex-trackjs';

// 埋点默认配置
Track.init({
  eventOptions: {
    open: true, // 开启事件采集
  },
  interfaceOptions: {
    open: true // 开启接口采集
  },
  stepOptions: {
    open: true // 开启步骤采集
  }
})

// 路由切换自动发送埋点信息
router.beforeEach((to, from, next) => {
  Track.sendTrackEvent();
  Track.sendInterface();
  Track.sendStep();
  next();
});

接口采集

在http.js中替换get,set方法用于接口数据的采集,采集接口http.js模版放置于 vortex-trackjs/utils/http.js

前端埋点使用

1、创建大步骤

window.trackStep.newstep("newstep",'大步骤')

2、创建子步骤

window.trackStep.newSubStep("newSubStep",'子步骤')

3、手动触发发送

window.trackStep.send();

Readme

Keywords

none

Package Sidebar

Install

npm i vortex-trackjs

Weekly Downloads

1

Version

1.4.1

License

ISC

Unpacked Size

17.8 kB

Total Files

4

Last publish

Collaborators

  • chyi722