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

tzgo

v1.8.2

Published

tz for outside

Downloads

16

Readme

埋点文件生成工具

安装

npm i -g tzgo

生成配置文件 trackConfig.json

track -i

生成埋点文件

track

默认在当前目录下生成track文件夹

埋点方法

import Track from '@/track/index';
import { handleFiboPageTrack } from 'track/generate/track';

// 必须先初始化再触发埋点
//埋点初始化
Track.init(userInfo);

//普通埋点
Track.report('加载页pvuv');

//单个编码
Track.report('加载页pvuv-编码N', '编码N', '确定');

//多个编码
Track.report('加载页pvuv-编码N-编码M', [
  ['编码N', '确定'],
  ['编码M', '取消']
]);

// 处理斐波翻页埋点,斐波初始化后调用一次即可
pageAndDurationTrack({
  routes: [], // 必传,需要触发埋点的路由,如:['/', '/About', '/Landing']
  query: {}, // 选传,具体看需求,通常传入当前链接上的参数即可,使用 rpf/un/
  itemId: '活动号' //apg环境必传
});

配置文件

  • 支持一个 excel 多个 sheet
  • 多个 sheet 时注意修改输出的文件名,否则会覆盖原来的映射文件名
  • 只会生成一个 track.js 文件,多次执行 track 指令不会覆盖原 track.js
// trackConfig.json
{
  "xlsxPath": "track.xlsx", // 埋点表格路径
  "outPath": "", // 生成文件的目录,默认为track
  "outType":"ts" //生成的文件类型,默认为ts,可选js
  "sheets": [
    {
      "sheetName": "埋点表", // 需要输出的sheet名
      "outputName": "index.js", // 输出的映射文件名,不带.js后缀会自动补全
      "excludeKey": [] // 埋点表格中要忽略的健,如 'PA__is_web'
    }
  ]
}

生成文件例子 ,见 example文件夹

生成的数据示例

/** 每日任务-邀请好友【去完成】按钮 */
  '每日任务-邀请好友【去完成】按钮': {
    Fibo__btn_name: '每日任务-邀请好友【去完成】按钮',
    Fibo__btn_id: 'btn-home-todo5',
    PA__event_id: '112211443',
    PA__label_id: '4990120-20201029559129',
    PA__is_web: '内部',
    Beacon__evt: 'todo5',
    Beacon__page_id: 'H5web_shouxian_activity_transfer_page ',
    Beacon__event_desc: 'flu',
    Beacon__channel: 'shouxian'
  },

其他

  • 生成的track.js文件,定义了菲薄和 apg 的埋点方法,可以再后面添加其他埋点方法,如好医生;
  • 检查项目中是否包含了埋点语句,track-check vs-code 插件