# trackEvent
-AA埋点方法
# 调用方式
trackEvent(params)
1
返回 Promise,使用 then/catch 或 await 处理结果。
# 请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| method | String | Y | state/action | |
| eventName | String | Y | page_view/click | |
| eventParams | Object | Y | {module: 'discover',page_name: 'discover_page'} |
# 接口调用示例
const param = {
method: 'state',
eventName: 'page_view',
eventParams: {
module: 'discover',
page_name: 'discover_page',
extra_channel_name: this.tabList[this.curIndex].title,
page_view_discoverchannel: '1',
}
}
this.$bridge.trackEvent(param)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# 返回参数
返回 Promise;原生返回数据的字段由宿主决定,当前 JS 封装未限定完整结构。