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

@alipay-inc/mpaas-mtracker-wxmini

v1.0.1

Published

1、安装npm包 ```javascript npm install @alipay-inc/mpaas-mtracker-wxmini ```

Downloads

6

Readme

配置

1、安装npm包

npm install @alipay-inc/mpaas-mtracker-wxmini

2、引入npm包

import { Tracker } from '@alipay-inc/mpaas-mtracker-wxmini';

初始化

Tracker.init({
  server: 'https://cn-hangzhou-mas-log.cloud.alipay.com/loggw/webLog.do', // 必填,接受埋点的服务地址
  appId: 'xxxxxxxxxx', // 必填,App 唯一标识
  workspaceId: 'default', // 必填,环境标识
  userId: '1234567890',      // 选填, 默认为空
  bizScenario: 'alipay',   // 选填,渠道来源,默认为空
  mtrDebug: true, // 选填,是否开启 mtracker 的 debug 模式,在 debug 模式下会打印上报的日志,默认为 false 不开启
  extendParams: { test: 111 } // 选填,全局扩展参数,默认为空,1.1.0 版本以上支持
});

接口

Tracker.click(eventId, options)

描述:点击埋点

Tracker.click('a1-b1', {
  bizType: 'Pay',
  ext: {
    productId: 'xxx'
  }
})

eventId

  • 释义:事件ID
  • 类型:String
  • 示例:
a1-b1

options

bizType
  • 释义:业务码
  • 类型:String
  • 示例:
Pay
ext
  • 释义:扩展参数
  • 类型:Object
  • 示例:
{
  productId: 'xxx'
}

Tracker.expo(eventId, options)

描述 曝光埋点

Tracker.expo('a1-b1', {
  bizType: 'Pay',
  ext: {
    productId: 'xxx'
  }
})

eventId

  • 释义:事件ID
  • 类型:String
  • 示例:
a1-b1

options

bizType
  • 释义:业务码
  • 类型:String
  • 示例:
Pay
ext
  • 释义:扩展参数
  • 类型:Object
  • 示例:
{
  productId: 'xxx'
}

Tracker.setUserId(userId)

Tracker.setUserId('xxx');

Tracker.changeTrackerExtendParams(ext)

描述 改变全局扩展参数

该功能自 1.1.0 版本起支持,如需使用该功能请升级

Tracker.changeTrackerExtendParams({
    productId: 'xxx'
})
ext
  • 释义:扩展参数
  • 类型:Object
  • 示例:
{
  productId: 'xxx'
}

预置扩展属性

| 属性ID | 说明 | | --- | --- | | userAgent | -(微信小程序内获取不到,故置为-) | | fullURL | 当前页面的完整 URL | | mBizScenario | 渠道来源 |

埋点格式

点击埋点

| 序号 | 字段名 | 字段值(示例) | | --- | --- | --- | | 01 | 日志头 | D-VM(固定值) | | 02 | 当前时间 | 2020-02-12 20:12:20 | | 03 | 客户端ID | 应用 ID_H5-workspaceId | | 04 | 微信客户端版本号 | 1.0.0 | | 05 | 日志埋点SDK版本 | 2(固定值) | | 06 | 终端ID | - | | 07 | 会话ID | d5557b75-ff80-4aab-86a6-9b1a522bbbce(生成uuid,存放在appInstance.globalData)| | 08 | uid | 1234567890 | | 09 | event | click(固定值) | | 10 | - | | | 11 | 上一级页面 ID|上一级页面位置 ID | url|postion | | 12 | - | | | 13 | - | | | 14 | - | | | 15 | - | | | 16 | seedId | PayResults | | 17 | - | | | 18 | 业务码 | Pay (默认值:UserBehaviorH5) | | 19 | - | | | 20 | - | | | 21 | - | | | 22 | - | | | 23 | 扩展字段 | k=v^k=v | | 24 | - | | | 25 | - | | | 26 | utdid | Wn1111111111111111111QxL (guid-timestamp ) | | 27 | - | | | 28 | - | | | 29 | - | | | 30 | - | | | 31 | - | | | 32 | - | | | 33 | - | | | 34 | 设备型号 | SM-N9500 | | 35 | 操作系统版本 | iOS | | 36 | - | | | 37 | - | | | 38 | - | | | 39 | 操作系统语言 | en | | 40 | - | | | 41 | CPU 核数 | - | | 42 | - | | | 43 | - | | | 44 | - | | | 45 | - | | | 46 | 分辨率 | 1920x1200 | | 47 | - | | | 48 | - | |

曝光埋点

| 序号 | 字段名 | 字段值(示例) | | --- | --- | --- | | 01 | 日志头 | D-VM(固定值) | | 02 | 当前时间 | 2020-02-12 20:12:20 | | 03 | 客户端ID | 应用 ID_H5-workspaceId | | 04 | 微信客户端版本号 | 1.0.0 | | 05 | 日志埋点SDK版本 | 2(固定值) | | 06 | 终端ID | - | | 07 | 会话ID | d5557b75-ff80-4aab-86a6-9b1a522bbbce(生成uuid,存放在appInstance.globalData)| | 08 | uid | 1234567890 | | 09 | event | exposure(固定值) | | 10 | - | | | 11 | 上一级页面 ID|上一级页面位置 ID | url|postion | | 12 | - | | | 13 | - | | | 14 | - | | | 15 | - | | | 16 | seedId | PayResults | | 17 | - | | | 18 | 业务码 | Pay (默认值:UserBehaviorH5) | | 19 | - | | | 20 | - | | | 21 | - | | | 22 | - | | | 23 | 扩展字段 | k=v^k=v | | 24 | - | | | 25 | - | | | 26 | utdid | Wn1111111111111111111QxL (guid-timestamp ) | | 27 | - | | | 28 | - | | | 29 | - | | | 30 | - | | | 31 | - | | | 32 | - | | | 33 | - | | | 34 | 设备型号 | SM-N9500 | | 35 | 操作系统版本 | iOS | | 36 | - | | | 37 | - | | | 38 | - | | | 39 | 操作系统语言 | en | | 40 | - | | | 41 | CPU 核数 | - | | 42 | - | | | 43 | - | | | 44 | - | | | 45 | - | | | 46 | 分辨率 | 1920x1200 | | 47 | - | | | 48 | - | |

页面打开自动化埋点

| 序号 | 字段名 | 字段值(示例) | | --- | --- | --- | | 01 | 日志头 | D-VM(固定值) | | 02 | 当前时间 | 2020-02-12 20:12:20 | | 03 | 客户端ID | 应用 ID_H5-workspaceId | | 04 | 微信客户端版本号 | 1.0.0 | | 05 | 日志埋点SDK版本 | 2(固定值) | | 06 | 终端ID | - | | 07 | 会话ID | d5557b75-ff80-4aab-86a6-9b1a522bbbce(生成uuid,存放在appInstance.globalData)| | 08 | uid | 1234567890 | | 09 | event | auto_openPage(固定值) | | 10 | - | | | 11 | 上一级页面 ID|上一级页面位置 ID | url|postion | | 12 | - | | | 13 | - | | | 14 | - | | | 15 | - | | | 16 | 当前页面URL | https://d.alipay.com | | 17 | - | | | 18 | 业务码 | Pay (默认值:UserBehaviorH5) | | 19 | - | | | 20 | - | | | 21 | - | | | 22 | - | | | 23 | 扩展字段(仅包含预置属性) | k=v^k=v | | 24 | - | | | 25 | - | | | 26 | utdid | Wn1111111111111111111QxL (guid-timestamp ) | | 27 | - | | | 28 | - | | | 29 | - | | | 30 | - | | | 31 | - | | | 32 | - | | | 33 | - | | | 34 | 设备型号 | SM-N9500 | | 35 | 操作系统版本 | iOS | | 36 | - | | | 37 | - | | | 38 | - | | | 39 | 操作系统语言 | en | | 40 | - | | | 41 | CPU 核数 | - | | 42 | - | | | 43 | - | | | 44 | - | | | 45 | - | | | 46 | 分辨率 | 1920x1200 | | 47 | - | | | 48 | - | |