千匠星云 统计埋点 -- @nebular.js/bury
安装 - install
yarn add @nebular.js/bury
npm install @nebular.js/bury
导入 - import
import { bury, increase } from "@nebular.js/bury";
使用 - use
bury({
agent: {
platform: true,
net: true,
os: true,
core: true,
browser: true,
shell: true,
screen: true,
ua: true,
extend: {
uuid: `uuid`
}
},
process: {
heart: 10000,
namespace: `burning`
},
event: {
attr: `action`
},
http: {
uri: `http://commerce.xytest.qjclouds.com/`,
preset: {
headers: {
hello: `world`
}
},
extend: {
custom: `value`
}
}
});
<div action="information">press me to save info into storage</div>
increase({ name: `joker` });
increase(params => {
return {
name: `joker`
}
});
在 HTML5 中使用 - use in H5
<script src="https://nebular.oss-cn-shanghai.aliyuncs.com/bury/nebular.bury.js"></script>
<script>
window.bury({
});
window.increase({
name: `joker`
});
</script>
数据格式 -- Data Format
{
"type": "heart",
"event": [
{
"time": "stamp",
"info": "information"
}
]
}