Code Monkey home page Code Monkey logo

flextracker's Introduction

安装

$ npm i
$ npm run build

使用

<script>
  window.flexTracker = {
    token: 'testtoken-123-456-789'
  }
</script>
<script  src="./tracker.js"></script>
<script>
  window.flexTracker.userdata('name', 'liuzhen')
</script>

token是必须的,这也是服务端区分不同用户的凭据

默认的配置如下:

var defaults = {
  enabled: true,      // 是否可用,关闭以后不再捕获和发送错误信息
  action: true,       // 是否监控并发送用户操作信息
  net: true,          // 是否hook ajax请求
  dependence: true,   // 是否发送页面上的依赖库信息,默认会有几个内置流行库的检测,剩余的通过遍历window对象获取
  compress: true,     // 是否压缩提交的数据,使用https://github.com/pieroxy/lz-string 整体性价比兼容性都比较靠谱
  autoStart: true,    // 自动开始,不想自动开始的话就设置成false,然后手动start
  report: {
    delay: 5000       // 报告发送的延迟时间(单位ms),如果一个时间段内有很多报告产生,那么就放到一起发送
  },
  ignoreErrors: [],   // 可忽略的错误
  ignoreUrls:[],      // 可忽略的url,那些产生错误的url
}

Q&A

不想自动开始监控?先设置autoStart为false

window.flexTracker = {
  token: 'testtoken-123-456-789',
  autoStart: false
}

然后,手动开启window.flexTracker.start()

flextracker's People

Contributors

catalsdevelop avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.