@xybplugins/xyb-agent 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/dist/index.esm.js +1 -3271
- package/dist/index.umd.js +1 -3279
- package/index.html +37 -0
- package/package.json +1 -1
package/index.html
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>测试文件</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<button onclick="sendTrack()">发送埋点</button>
|
|
9
|
+
<script src="./dist/index.umd.js"></script>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
window.xybAgent?.init('production').then(res=>{
|
|
13
|
+
console.log("是否初始化已完成", res);
|
|
14
|
+
});
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
sendTrack();
|
|
17
|
+
}, 1500);
|
|
18
|
+
|
|
19
|
+
function sendTrack() {
|
|
20
|
+
console.log(window.xybAgent);
|
|
21
|
+
const obj = {
|
|
22
|
+
code: 'XYB_SYY_430500_SYSCGSSP',
|
|
23
|
+
name: '堵路移车',
|
|
24
|
+
source: '', //访问渠道
|
|
25
|
+
page_source: '', // 访问量来源
|
|
26
|
+
aff_city_code: '4305001111',
|
|
27
|
+
aff_city_name: '邵阳市',
|
|
28
|
+
unit_code: '4305',
|
|
29
|
+
unit_name: '邵阳市',
|
|
30
|
+
category: '2',
|
|
31
|
+
};
|
|
32
|
+
console.log('上报的数据', obj)
|
|
33
|
+
window.xybAgent.track('pageview', obj);
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|