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

asp-smart-collection

v1.0.17

Published

- 第一步 安装依赖 cnpm i asp-smart-collection -S - 第二部 在 main.js 中引入 - 引入 import { Track } from 'asp-smart-collection' - 注册挂载 Vue.prototype.$Track = Track - 初始化 this.$Track.init(config) 初始化需要传配置参数 - init 方法 参数说明 类型 Object {} - url 字段类型 String 说明:请求 url

Downloads

23

Readme

使用方式

  • 第一步 安装依赖 cnpm i asp-smart-collection -S
  • 第二部 在 main.js 中引入
  • 引入 import { Track } from 'asp-smart-collection'
  • 注册挂载 Vue.prototype.$Track = Track
  • 初始化 this.$Track.init(config) 初始化需要传配置参数
    • init 方法 参数说明 类型 Object {}
    • url 字段类型 String 说明:请求 url 用户向后端提交收集到的信息 【必须】
    • userInfo 字段类型 Object 说明:用户信息 【非必须】
    • isTrackOnly 字段类型 Bool 说明:设置为 true 时,只支持有痕埋点 aspTrackEvent(event, data)
    • aspRequest 字段类型 function 说明:用于提交给后台收集到的信息的 API 【非必须】url, data

组件上报给后端服务器的参数说明如下:

无痕 PV 参数-事件点击行为

  • { host, hashPath, fullPath, trackPath, userInfo, createTime, eventType, trackingType }
    • host 字段类型 String 说明:域名地址 ip+端口 eg: http://localhost:10001/
    • hashPath 字段类型 String 说明:页面地址带 hash 不带路由参数 eg:http://localhost:10001/#/login
    • fullPath 字段类型 String 说明:页面的完整地址 带路由参数 eg: http://localhost:10001/#/login?id=233
    • trackPath 字段类型 String 说明:事件轨迹 UV 事件时为空
      • 1、如果标签中有定义标识 如:点击, 此时 trackPath 的值就是“点击按钮 ID”
      • 2、如果没有定义标识,但 dom 元素中有描述 如 点击 此时 trackPath 的值就是“div>button>span>点击”
      • 3、没有标识 也没有描述 如: 则返回标签轨迹 此时 trackPath 的值就是 “div>button>span”
    • createTime 字段类型 String 说明:事件触发时间 yyyy-mm-dd hh:mm:ss 年月日 时分秒
    • userInfo 字段类型 Object 说明:用户信息 由外部传入
    • eventType 字段类型 String 说明:事件类型 如:click
    • trackingType 字段类型 String 说明:数据收集类型 "1"为无痕 "2"为有痕
    • offsetX 字段类型 String 说明:点击页面时的 x 坐标
    • offsetY 字段类型 String 说明:y 坐标

无痕 PV 参数-页面跳转行为

-- { host, fullPath, hashPath, userInfo, createTime, trackPath ,userInfo, fromPath}

  • fromPath 字段类型 String 说明:进入当前页面的前一个页面的完整地址 eg:http://localhost:10001/#/home
  • host 字段类型 String 说明:域名地址 ip+端口 eg: http://localhost:10001/
  • hashPath 字段类型 String 说明:页面地址带 hash 不带路由参数 eg:http://localhost:10001/#/login
  • fullPath 字段类型 String 说明:页面的完整地址 带路由参数 eg: http://localhost:10001/#/login?id=233
  • trackPath 字段类型 String 说明:事件轨迹 UV 事件时为空
  • createTime 字段类型 String 说明:事件触发时间 yyyy-mm-dd hh:mm:ss 年月日 时分秒
  • userInfo 字段类型 Object 说明:用户信息 由外部传入
  • eventType 字段类型 String 说明:事件类型 如:click
  • trackingType 字段类型 String 说明:数据收集类型 "1"为无痕 "2"为有痕

用户 UV 行为需要后台根据上传的数据自行过滤

有痕埋点 在代码中植入 aspTrackEvent(event, data)

  • 包含无痕 PV 的所有信息 在此基础上 增加用户自定义的参数 data

  • event 说明:事件触发时的 event 信息

  • data 说明:用户自定义的信息 字段类型 Object

  • 用法 this.$smartCollection.aspTrackEvent(event, data)

  • 例如在 vue 页面总绑定点击事件 <el-button @click="(event) => { handleClick(event, '测试点击') }">点击

  •     handleClick (event, i) {
  •        const data = { test: '2342' }
  •        this.$smartCollection.aspTrackEvent(event, data)
  •    },

外部 API

aspSetOtherInfo(otherInfo) 补充设置埋点需要收集的额外信息

  • 参数说明 otherInfo 字段类型 Object 数据收集的额外补充信息
  • 用法 this.$smartCollection.aspSetOtherInfo(otherInfo)