-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathburied.html
72 lines (66 loc) · 1.92 KB
/
buried.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no,viewport-fit=cover" />
<title>获取埋点</title>
<script src="js/tools.js"></script>
<!-- <script src="js/centalab-sdk.js"></script> -->
<script src="js/monitor.readinfo.min.js"></script>
<!-- <script src="https://imonitor.centaline.com.cn/sdk/centalab-sdk.js"></script> -->
</head>
<body>
<button id="jumpUrl">点击我跳转地址</button>
<button id="copyText">点击我复制内容</button>
</body>
<script>
var pageBuriedData = {
obj: '123143',
send: '123124'
}
let lab = new window.centaIOSdk();
console.log(lab);
lab.pageLoad();
lab.init({ isLog: true, isMonitor: true })
// lab.customerInfo({
// })
jumpUrl.onclick = function (e) {
location.pathname = 'qrcode.html'
let data = lab.clickElement(e)
lab.trigger(data)
}
function sendMonitorInfo(ev, customData) {
//此方法为点击事件埋点方法 需要事件对象
//ev为事件对象 不传的话默认取body, customData为需要传递的参数 会合并到埋点要发送的对象里
ev = ev || document.body;
var data = lab.clickElement(ev)
data = Object.assign(data, customData)
lab.trigger(data)
}
function sendMonitorLoadInfo(customData) {
// 此方法为页面加载事件方法
//customData为需要传递的参数 会合并到埋点要发送的对象里
var data = lab.pageLoad()
data = Object.assign(data, customData)
lab.trigger(data)
}
copyText.onclick = function () {
wx.setClipboardData({
data: 'data', // 设置的
success: function (res) {
console.log(res.errMsg)
}
})
}
async function checkAwait() {
await tools.sleep(5000).then(res => {
console.log('is then');
sendMonitorLoadInfo()
})
console.log(tools);
}
checkAwait()
</script>
</html>