1.1.2 • Published 7 months ago

nuanyang-tracker v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

tracker

这是一个埋点 SDK This is a buried SDK

使用方法如下 The usage is as follows

import Tracker from 'nuanyang-tracker';

const tr = new Tracker({
  requestUrl: 'xxxxxx',
  historyTracker: true,
  domTracker: true,
  jsError: true,
});

Options introduction

/**
 * @requestUrl 接口地址
 * @historyTracker history上报
 * @hashTracker hash上报
 * @domTracker 携带tracker-key 点击事件上报
 * @historyTracker 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;
}

usage

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./dist/index.js"></script>
    <button tracker-key="btn">埋点按钮</button>
    <button>无埋点按钮</button>
    <button onclick="undefinedFunction()">js报错按钮</button>
    <script>
      new tracker({
        requestUrl: 'http://localhost:9000/api/track',
        historyTracker: true,
        domTracker: true,
        jsError: true,
      }); // 初始化
      function undefinedFunction() {
        console.log('undefinedFunction', aaaa);
      }
    </script>
  </body>
</html>
1.1.2

7 months ago

1.1.1

7 months ago

1.0.11

7 months ago

1.0.10

7 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

8 months ago

1.0.0

8 months ago