cl-tracker
v1.0.2
Published
一个埋点 SDK
Downloads
2
Readme
一个埋点 SDK
使用方法如下
<button onclick="handler()" tracker-key="btn">有埋点点击事件</button>
import Tracker from "cl-tracker";
const tr = new Tracker({
requestUrl: "xxx",
historyTracker: true,
hashTracker: true,
domTracker: true,
jsError: true,
});
可配置参数介绍
/**
* @requestUrl 接口地址
* @historyTracker history上报
* @hashTracker hash上报
* @domTracker 携带tracker-key 点击事件上报
* @sdkVersion sdkVersion sdk版本
* @historyTracker extra 透传字段
* @jsError js 和 promise 报错异常上报
*/
export interface DefaultOptons {
uuid: string | undefined;
requestUrl: string | undefined;
historyTracker: boolean;
hashTracker: boolean;
domTracker: boolean;
sdkVersion: string | number;
extra: Record<string, any> | undefined;
jsError: boolean;
}