0.1.2 • Published 1 year ago

nw-target-attribution v0.1.2

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

nw-target-attribution

投放归因指定页面SDK,站外投放的时候用于收集页面参数并上报

使用

import Attribution from 'nw-target-attribution'

const attribution = new Attribution({
  paramsMode: 'search',
  needExtraParams: true
});
attribution.report({
  targetUrl: 'https://www.lofter.com',
  extraData: {
    a: 1,
    b: 2
  }
})

参数

Attribution 构造函数接受一个配置对象,配置对象包含以下属性:

  • paramsMode: 页面参数收集模式,可选值为 searchhash,默认值为 search

  • needExtraParams: 是否需要除了 clickId 以外的页面参数,可选值为 truefalse,默认值为 false

Attribution 实例的 report 方法用于上报数据,接收以下参数

  • targetUrl: 打开APP需要跳转的页面地址

  • extraData: 额外参数,可选

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago