1.0.14 • Published 4 years ago

front-data-buried v1.0.14

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

数据埋点

安装

npm install front-data-buriedyarn add front-data-buried

必传参数

interface ContentObject {
    offset_x: number;//点击位移x
    offset_y: number;//点击位移y
    element: {
        to_element: Array<string>;//路径
        inner_html: string;//内包含文字
        h_b: boolean;//是否有业务功能
    };
}

interface EventsObject {
    event: string;//事件类型
    time: number;//点击时间
    content: ContentObject; //点击内容
}

interface AllEventObject {
    page_title: string; //当前页面名称
    pre_title: string; //来源页面
    atom_id: string;//用户全局唯一id
    soft_name: string;//项目名称
    screen_x: number;//设备宽度
    screen_y: number;//设备高度
    events: Array<EventsObject>;//监听事件获取的数据
    load_time: number;//页面初次进入时间
    up_time: number;//报文上报事件
}

使用方法

在路由页或可以全局监听并获取用户信息的页面注入

import {GetAllEvent} from 'front-data-buried'

const eParams = {
    atom_id: '',//用户唯一标识
    soft_name: 'refee_1',//手机端续费:refee_1,车机:refee_2
    screen_x: window.screen.availWidth,
    screen_y: window.screen.availHeight,
    load_time: Date.now(),
    root:'',//请求根路由
    url:'',//请求路径
}
GetAllEvent({ ...eParams })
1.0.14

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.12

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago