|
/

异步上报问题

Ww****13
发布于 3 年前
129来自江苏省
移动统计 U-App

async setYouMengUserInfo() {
const { aplus_queue } = window
//如采集用户信息是异步行为,需要先阻止SDK上报,设置BLOCK埋点
aplus_queue.push({
action: 'aplus.setMetaInfo',
arguments: ['_hold', 'BLOCK']
})

setTimeout(() => {
//异步耗时流程 (如获取user_id)

let userId = 'test_' + parseInt(Math.random() * 100)
console.log('youmeng-userId=', userId)
aplus_queue.push({
action: 'aplus.setMetaInfo',
arguments: ['_user_id', userId]
})
aplus_queue.push({
action: 'aplus.setMetaInfo',
arguments: ['_hold', 'START']
})
}, 3000)
},

设置了异步之后,3秒后设置为 START。日志不能正常发送

1个回答
 
3 年前
来自浙江省

你好,你是如何集成的呢?完整的集成代码提供一下,这边看下。

Loading ...
登录社区,分享你的经验