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 🙏

© 2026 – Pkg Stats / Ryan Hefner

visual-buried-point-platform-uni

v2.0.7-alpha.2

Published

To make it easy for you to get started with GitLab, here's a list of recommended next steps.

Downloads

454

Readme

微信小程序及uni端埋点SDK集成文档

SDK更新日志

  • v1.0.0-alpha.07 最新uni、终端通用埋点sdk;
  • v1.0.0-alpha.08 自定义上报数据结构删除path字段;
  • v1.0.0-alpha.35 调整SDK内部PVUV采集模式,分原有start方法采集及自动采集,支持获取埋点sdk内的跟踪id;
  • v2.0.0 调整SDK内部PVUV采集模式,分原有start方法采集及自动采集,支持获取埋点sdk内的跟踪ID;
  • v2.0.3 修复已知bug;
  • v2.0.4-alpha.11 修复已知bug、调整立即上报参数、优化打包SDK;

1、引入方式

//内网npm链接:http://verdaccio.gogdev.cn/
npm install visual-buried-point-platform-uni

2、初始化方式

import { init } from 'visual-buried-point-platform-uni'
onLaunch: function() {
      //初始化sdk
      init({
        env: 'test', //环境变量 test production
        token: '3212414516342554624', //热果平台-可视化埋点管理端-创建对应的项目生成. 
        domain: 'com.gzdzswy.onetravel', // 必填,访问来源域名,取优先级:单次调用上报值 > 全局初始化值
        isCompatible: true, // 是否兼容老方案埋点,默认兼容true
        signTrackArray: [], // 自动采集但需要单独埋点的页面path
      })
    }
});

3、设置绑定用户ID

  • sdk初始化后,可通过 setUserId() 方法关联用户,sdk会默认生成一个游客ID
// 应用在注册或登录成功后,可调用下面API设置用户ID,后续产生的统计事件将会与该用户关联起来
setUserId("登录成功-用户ID")

示例:

import { setUserId } from 'visual-buried-point-platform-uni'
setUserId(123456);

注:为保持数据统计精确,在退出登录的时候调用一次清空:

setUserId("");

4.获取埋点SDK内跟踪ID

import { getTrackId } from 'visual-buried-point-platform-uni'
getTrackId()

5、自定义事件上报

  • sdk初始化后,可通过 setCustomEvent() 方法上报自定义埋点事件,并为事件添加属性值:

5.1 事件类型:

  • 仅能选择埋点提供的事件类型,各事件类型的触发、上报由各业务平台埋点自行确认。事件类型如下:
  • 搜索事件【 search 】
  • 动作事件【 action 】
  • 点击事件【 click 】
  • 浏览事件【 browse 】
// 调用自定义上报
setCustomEvent(data)

配置:

| 参数 | 必填 | 类型 | 描述 | | ------------- | ---- | ------- | ------------------------------ | | $event_id | 是 | string | 对应创建的事件ID 【图2】 | | $extend_param | 否 | string | 扩展字段,建议根据业务需求填上 | | $busSegment | 否 | number | 业务板块 【表1】各自业务板块 | | $module | 否 | number | 业务模块【表1】各自业务模块 | | $event_code | 是 | string | 对应创建的事件标识符 | | $sendMode | 否 | boolean | 此次上报数据是否立即上报 |

表1

示例如下:
业务板块        业务模块
busSegment     module
1.景区/门票   1.门票
2.民宿/酒店   1.民宿 2.酒店

示例:

// 注:
data: JSON字符串
{
    $event_id: 对应创建的事件ID 【必填字段】
    $extend_param: 扩展参数(JSON字符串) 【非必填字段,建议根据业务需求填上】
    $busSegment: 业务板块 【非必填字段,建议业务填上, 否则数据统计可能出现缺失】
    $module: 业务模块 【非必填字段,建议根据业务填上, 否则数据统计可能出现缺失】
    $event_code: 渠道推广编码 【非必填字段,建议根据业务填上, 否则数据统计可能出现缺失】
    $duration: 停留时长 【非必填字段】
    $event_code: 事件标识符 【必填字段,建议根据业务填上, 否则数据统计可能出现缺失】
    $sendMode: 数据上报模式 【非必填,当前此次埋点数据是否立即上报】
    $page: 当前页对象 【非必填字段,建议根据业务填上, 否则数据统计可能出现缺失】
}
import { setCustomEvent } from 'visual-buried-point-platform-uni'
// 参考:【点击事件】
const params = {
    $event_id: "3213106620739878912",
    $event_code: "2139oNf0te6kf0DvltL",
    $busSegment: 1,
    $module: 1, 
    $sendMode: true
    $extend_param: { 
        title: "自定义[点击事件]上报-点击_密码登录按钮", 
        clickContent: "密码登录",
      ....
      ....
    },
    $page: {
      domain: "",
      path: "",
      title: "",
    },
}
setCustomEvent(params)

6、流量上报

  • sdk初始化后,可通过onStartTrack(params) 方法注册上报流量,并为上报添加属性值:

注册上报流量:onStartTrack(params)

配置:【以下配置参数建议上报】

| 参数 | 必填 | 类型 | 描述 | | ------------ | ---- | ----------- | ------------------------ | | domain | 否 | string | 域名 | | busSegment | 否 | string | 业务板块 【表1】 | | module | 否 | string | 业务模块 【表1】 | | extend_param | 否 | JSON对象 {} | 扩展参数 | | sourceDomain | 否 | string | 访问来源域名 | | sourceUrl | 否 | string | 访问来源url | | title | 否 | string | 页面名称 | | sendMode | 否 | boolean | 此次上报数据是否立即上报 |

示例:

import { onStartTrack } from 'visual-buried-point-platform-uni'
// 注:
data: JSON对象
const params = {
  domain: "xxxx",
  busSegment: 1,
  module: 1,
  title: "店铺详情",
  sourceDomain: 'com.gzdzswy.onetravel',
  sendMode: true,
  extend_param: {
      goods_id: 123456, //商品id 【根据业务确定】
      store_id: 1111, //店铺id   【...】
      business_id: 222, //商户id 【...】
  }
};
onStartTrack(params)

销毁流量上报:调用onDestroyTrack()进行销毁

示例:

import { onDestroyTrack } from 'visual-buried-point-platform-uni'
onDestroyTrack()

注: 上报数据是否成功可查看NetWork栏,调用流量上报 track 接口 和 自定义上报 event 接口的 response

7、埋点后台管理系统

云测管理端地址
  • chameleon.gcongo.com.cn

8、SDK 文档

http://verdaccio.gogdev.cn/-/web/detail/visual-buried-point-platform-uni