npm install sd-track-event --save
Vue.use(sdTrackEvent, {
biz: 'cf',
selfTag: storage.get('uuid')
authorizationV2: xxx
})
切换路由使用:
this.$sdTrackEvent.send({
op: 'page_enter',
fromPath: from.fullPath,
subChannel: '',
toPath: to.fullPath,
pageName: to.name,
channel: to.query.channel,
testCode: to.query.grayMode,
extInfo: {
case_id: to.params.infoUuid || to.query.infoUuid
}
})
点击事件绑定:
<div v-sd-track="'ID'" data-test-flag="2" data-ext-info-test_test="test" .....></div>
新增方法:
this.$sdTrackEvent.getUserSourceId()
this.$sdTrackEvent.getShareId()
this.$sdTrackEvent.getSelfShareId()
url = this.$sdTrackEvent.setShareParams(url)
selfTag: '',
biz: '',
authorizationV2: '',
channel: '',
elementCode: '',
testCode: '',
platform: 'wx',
subChannel: '',
fromPath: '',
toPath: '',
extInfo: ''