1.1.1 • Published 3 years ago

set-behavior v1.1.1

Weekly downloads
12
License
ISC
Repository
-
Last release
3 years ago

set-behavior

统计用户行为(点击事件以及页面停留时长)

Installing

Using npm:

$ npm install set-behavior --save

Usage

统计用户行为的函数调用方法
  // 引入及初始化
  import CustomerBehavior from 'set-behavior'
  const customerBehavior = new CustomerBehavior({
    saveBehaviorUrl: '', // 保存用户行为的后端接口,必填
    stayTimeUrl: '' // 停留时长的后端接口,必填
  })
  // 使用
  /**
   *  behavior // 行为名称【必传】
   *  pageId // 页面的id【必传】
   *  ext: // 自定义属性对象,用于存放用户唯一标识或其他拓展字段
   */
  customerBehavior.saveBehavior({behavior, pageId, ext})

  
  
用户停留时长
// 开始计时
customerBehavior.startStayTime({pageId, duration, ext})
// 清除定时
customerBehavior.clearTimer()
1.1.1

3 years ago

1.1.0

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