Git Product home page Git Product logo

collector's Introduction

#信息采集

通用信息

  • 用户数据
  • 设备信息
  • 系统版本号

页面信息

  • 当前地址
  • 页面停留的时间
  • 视口的位置
  • 页面性能
  • 页面错误信息
  • 跳转的目标URL
  • 页面点击收集的目标数据

自定义收集

  • 加入购物车等

api

初始化参数

  1. url
  • type:String
  • default: null
  • desc: 请求的接口地址
  1. timeInterval
  • type: integer
  • default: 60000
  • desc: 接口轮循时间 单位(ms)
  1. transformRequest
  • type: func[object]
  • default: null
  • desc: 自定义处理请求接口的参数方法 返回类型object
  1. clickCallback
  • type: promise
  • default: null
  • desc: 点击后的处理 返回处理后的数据
  1. isSingePage
  • type: boolean
  • default: true
  • desc: 是否是单页应用
  1. dataSize
  • type: integer
  • default: 4076
  • desc:收集数据的最大值,由于ie浏览器的限制get请求不能超过4076b,单位b

方法

  1. setConfig[void]

desc: 设置配置,传入一个对象

  1. getConfig[object]

desc: 获取配置

  1. setData[void]

desc: 往实例中设置数据,会轮循传入后端

  1. setDefaultData[void]

desc: 非实时数据,当超过最大阀值,保留这部分数据传入后端

  1. getData[object]

desc: 获取当前的基本数据

  1. sendCollectData[void]

desc: 发送数据,会把传入的数据和已收集的数据组合发到后端

  1. eventEmitter.emit('collectError', data)

desc: 收集错误信息勾子,需手动调用

  1. eventEmitter.emit('pageStartCollect')

desc:进入页面钩子,开始收集页面信息,需要手动调用(单页)

  1. eventEmitter.emit('pageEndCollect')

desc: 离开页面钩子,重置数据等,需要手动调用

collector's People

Watchers

James Cloos 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.