1.2.9 • Published 11 months ago
buried-log v1.2.9
Buried Log
BuriedLog.js 是一个用于 Web 前端应用埋点收集上报的 JavaScript 库。
快速开始
安装
npm install buried-log --save
API
初始化
import BuriedLog from 'buried-log'
const baseURL = 'http://localhost:3000'
const config = {
appName: 'buried_log_test',
}
const log = new BuriedLog(baseURL, config)
PV 埋点上报
log.sendPv('home', { shopId: '3799', productId: '9844' })
点击埋点上报
log.sendClick('login', { username: '18888888888' })
脚本引入
<script src="path/dist/buried-log.min.js"></script>
<script>
const log = new window.BuriedLog('http://localhost:3100', {
appName: 'buried_log_test',
appVersion: '0.0.1',
})
log.sendPv('home', { shopId: '3799', productId: '9844' })
</script>