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

golcer-analysis-web

v0.2.1

Published

高灯数据分析 Web SDK

Readme

高策数据分析 Web SDK

高策数据分析(Golcer Data Analysis)缩写 GDA

集成准备

  1. 向高策相关人员申请 AppKey
  2. 下载安装
npm install golcer-analysis-web --save

支持 jsDelivr

<script src="https://cdn.jsdelivr.net/npm/golcer-analysis-web@latest"></script>

快速集成

import GDA from 'golcer-analysis-web'

GDA.init({
  appKey: '通过高策申请获取的 AppKey',
  autoTrack: false, // 是否自动上报,单页应用关闭此项通过主动上报 PV
  logger: true // 设置为 true 后会在控制台显示发送的数据
})

API

GDA.init(Object config)

参数

| 属性 | 类型 | 默认值 | 必填 | 说明 | | ----------- | ------- | ------ | ---- | --------------------------------------------- | | appKey | string | | 是 | 通过高策申请获取的 AppKey | | autoTrack | boolean | true | 否 | 是否自动上报,单页应用关闭此项通过主动上报 PV | | logger | boolean | | 否 | 设置为 true 后会在控制台显示发送的数据 |

GDA.pageView()

主动触发 PV($Web_page_view) 事件

GDA.track(String eventName, Object data)

上报自定义事件

参数

| 参数 | 类型 | 默认值 | 必填 | 说明 | | --------- | ------ | ------ | ---- | ---------------- | | eventName | string | | 是 | 自定义事件英文名 | | Data | object | | 否 | 自定义事件属性 |

GDA.setUserID(String userID)

设置用户 ID

GDA.setUserProfile(Object data)

直接设置用户的属性,如果存在则覆盖。

GDA.setUserOnceProfile(Object data)

如果不存在则设置,存在就不设置。

GDA.setUserIncrementProfile(Object data)

对当前用户的属性做递增或者递减。

// 表示 attrname 递减
gda.setUserIncrementProfile({ attrname: -1 });
// 表示 attrname 递增
gda.setUserIncrementProfile({ attrname: 1 });

GDA.setUserAppendProfile(Object data)

给数组属性添加值。通过 setProfile 只能改变属性的值。如果这个属性是数组类型的,你不想完全改变这个值,只想做添加操作可以使用此方法。

预置事件

| 事件名 | 事件显示名 | 事件属性 | 属性类型 | 说明 | | ----------------- | ------------ | ------------------- | -------- | ------------------------------------------------------------ | | $Web_page_view | 浏览页面 | $title | string | 页面 <title> 标签的内容 | | - | - | $host | string | 页面地址域名,服务端解析 request headers host | | - | - | $path | string | 页面路径,不含域名 | | - | - | $search | string | URL query 参数,如:https://example.com?a=1&b=2 中的 a=1&b=2 | | - | - | $url_hash | string | URL hash 值,如:https://example.com/#top 中的 #top | | - | - | $referrer_host | string | 前向地址的域名 | | - | - | $referrer_path | string | 前向地址的路径 | | - | - | $referrer_search | string | 前向地址的 search 部分 | | $Web_user_click | 元素点击事件 | $element_type | string | 元素标签名 | | - | - | $element_content | string | 元素内容 | | | | $element_selector | string | 元素 css 选择器 |

所有事件都有的预置属性

| 属性名 | 属性类型 | 说明 | | ------------------ | -------- | ------------------------------------------------------------ | | $is_first_time | boolean | 新用户首次访问页面时,触发的第一个 PV ,该属性值为 true,后续再触发 PV 事件时,该属性都为 false | | $lib_version | string | SDK 版本号,请求参数中的 version | | $screen_width | number | 屏幕宽度 | | $screen_height | number | 屏幕高度 | | $ip | string | IP,服务端通过 HTTP 请求得到 | | $timezone_offset | number | 时区偏移量 | | $title | string | 页面 <title> 标签的内容 | | $url_query | object | URL query,如:https://example.com/a=1&b=2{ a: "1", b: "2" } |