npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

neky-report-vue

v0.0.5

Published

前端无痕埋点,用户行为监控,访客识别,UAT方案。

Downloads

1

Readme

neky-report

web ubt report.

前端数据采集,UBT方案

    无痕埋点,
    用户行为监控,
    访客识别,
    api监控

安装//Install

npm install neky-report --save

ES6

import nekyReport from 'neky-report'

CommonJS

var nekyReport=  require('neky-report');

直接引用//Direct include

<script src="../node_modules/neky-report/src/index.js"></script>

使用方法//Usage

    let nekyRet = nekyEeport.init({ 
        url: 'https://localhost:3000/zc.gif', //采集地址,采用发送一张1x1的图片带上参数进行数据采集
        isClick: false, //是否全量点击,监听整个页面所有的点击事件
        uid: '', //采集用户的ID,默认为空,用户数据也可在后续的回调中带上
        clickAttr: {
            // dom: ['div'], 需要采集的DOM名称
            // className: ['aaa'], 需要采集的类目,需与DOM名称一起使用,采集某个DOM里有某个类目的DOM节点的数据
            noClassDom: ['a'], //无需类目的采集所有设定的DOM节点的数据
            attr: [{
                objKey: 'clickId', //设定返回数据的名称
                attrKey: 'data-src', //DOM节点需要采集的数据
                isUp: false, // 是否向逐一向上查找元素
                tag: 'a div' //对应上面设定好的DOM
            },{
                objKey: 'href',
                attrKey: 'href',
                tag: 'a'
            },{
                objKey: 'clicksId',
                attrKey: 'data-url',
                tag: 'a'
            }],
            fun: function (data) {
                return data //点击事件返回上面设定好的数据,可进行改造后再上传给采集中心
            }
        }
    })

API

    nekyRet.watchApi(name,fun) //接收两个参数被监听的API的名称,以及监听成功后的回调函数。
    nekyRet.watchRead(fun) //页面加载后的一个回调。
    nekyRet.setData(data) //接收一个参数为需要同时上传给采集中心的数据。

cookie设置

_zca:  00000.XXXXX.11111.22222.33333.44444
_zcb:  00000

基础数据/data

data = {
    //采集代码的版本
    jv: '1.0.0',
    //访客ID
    vid: 1532487238279.1f625pu,
    //用户ID
    uid: xxxxxx,
}

data01 = {
    //用户的设备是PC还是Mobile还是Tablet
    device: 'PC',
    //用户操作系统和系统版本
    os: 'Mac 10.12.6',
    //用户浏览器名称和浏览器版本
    browser: 'Chrome 68.0.3440.84',
    //用户的屏幕分辨率
    screen: '970x1920',
    //用户当前访问的页面的URL
    pageUrl: 'https://localhost:3000/'',
    //用户的来源
    referer: 'https://localhost:3000/'',
    //用户的访问路径
    accessPath: https://localhost:3000/, https://localhost:3000/index, https://localhost:3000/index/list,
    //用户浏览器语言
    language: 'zh-CN',
    //用户行为采集的时间
    time: 1533366007865
}

基础数据说明

_zca

0000代表用户第一次访问时生成的时间戳
XXXX代表用户第一次访问时随机生成的字符串
111111代表用户上一次访问时生成的时间戳
22222代表用户当前访问时生成的时间戳
33333代表用户访问网站的次数(vv)
44444代表用户访问网站页面的次数(pv)

_zcb:

一个30分钟后过期的session

用户唯一性:

采用00000+XXXX的方式来确认用户的唯一性。 
例子:1532487238279.1f625pu     //唯一用户:1532487238279.1f625pu

fullpv

采用00000+XXXX+33333+44444的方式来确认用户完整的PV。
例子:1532487238279.1f625pu.12.169  //唯一用户:1532487238279.1f625pu  的第 12 次访问网站,访问了169个页面

类型说明

load: //页面加载
    基础数据(data, data01),
    //用户访问网站页面的次数
    pv: fullPv(),
    
beforeunload:  //页面跳转
    基础数据(data, data01),
    //开始时间
    startTime: 1533633324661,
    //结束时间
    endTime: 1533633324661,

unload:  //页面关闭
    基础数据(data, data01),
    //开始时间
    startTime: 1533633324661,
    //结束时间
    endTime: 1533633324661,

click:  //点击
    基础数据(data),
    //用户的设备是PC还是Mobile还是Tablet
    device: 'PC',
    //发生点击的页面
    pageUrl: https://localhost:3000
    //点击点在页面的X轴
    pageX: 111,
    //点击点在页面的Y轴
    pageY: 222,
    //发生点击事件按钮的DOM树结构
    domPath: domPath,

impression //页面展示
    //展示的页面
    pageUrl: https://localhost:3000
    //展示的时间
    time: (new Date).getTime(),
    //展示的用户PV
    pv: fullPv()

License

MIT