简介
对项目进行“界面”、“自定义事件”埋点,通过“tommyrunner”平台进行查看数据。
tommyrunner 平台:链接暂无
-
npm
- 安装
npm i t-point-sdk --save
- 引用
// js import tPointSdk from "t-point-sdk"; // ts : const tPointSdk = require("t-point-sdk") // 初始化 point埋点(初始化成功后默认开启界面埋点) tPointSdk.init("appKey", "secretKey", { debug: true });
参数 1:通过"tommrunner"获取 appKey
参数 2:通过"tommrunner"获取 secretKey
参数 3:config{ debug:是否开启调试模式,baseUrl:埋点服务器地址,testUrl:测试服务器地址 }
-
cdn
- 安装
<script src="https://cdn.jsdelivr.net/npm/t-point-sdk"></script>
- 引用
<script type="module"> let tp = tPointSdk.init("appKey", "secretKey", { debug: true }); </script>
默认初始化自动开启抓捕
- 1、通过“tommyrunner”平台“自定义事件”注册事件得到 事件 key
<script type="module">
let tp = tPointSdk.init("appKey", "secretKey", { debug: true });
// 某个按钮点击事件
window.test = () => {
tp.event("事件key", "其他参数(可选)");
};
</script>
<!-- npm 引入方式同理,init返回对象含有event对象 -->
- 管理项目
- 统计-项目地区访问
- 统计-火热界面
- 统计-本月 7 天数据
- 统计-设备占比
- 统计-当前在线设备
- 等等