@tdit/web-track
TypeScript icon, indicating that this package has built-in type declarations

3.0.4 • Public • Published

前端事件采集

安装

npm install @tdit/web-track

全局配置

import {configure} from '@tdit/web-track'
import { createBrowserHistory } from 'history';
import { matchPath } from 'react-router-dom';

const history = createBrowserHistory();

const routes = [{ path: '/users/:userid' }, { path: '/users' }];

configure({
  endpoint: '',
  siteId: 'teamwork',
  environment: process.env.NODE_ENV,
  auto: false, // 是否自动检测url变化,默认为false
  autoGa: false, // 使用data-ga属性采集事件
  reactRouter: { // 监听react-router, 默认为undefined
    history: history,
    routes: routes,
    matchPath: matchPath
  }
})

Readme

Keywords

none

Package Sidebar

Install

npm i @tdit/web-track

Weekly Downloads

1

Version

3.0.4

License

none

Unpacked Size

502 kB

Total Files

34

Last publish

Collaborators

  • lingjie