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

tezign-content-tracker

v1.1.20

Published

## SDK 集成

Downloads

196

Readme

使用说明

SDK 集成

要正常采集内容相关数据并发送给特赞,需要引入 sdk,并初始化配置

  1. 方式 1 :同步载入
<script charset="UTF-8" src="tezign-content-sdk.min.js"></script>
<script>
  const TZContentTracker = window['TZContentTracker'];
  const tracker = new TZContentSensors({
    env: 'development', // 运行环境,非必填,默认 development
    tenant_id: 't2', // 租户id, 必填
    user_id: 'user_1234', // 用户id,非必填,可以在登录后调用setUserId进行设置
    is_track_single_page: true, // 单页面配置,默认开启,若页面中有锚点设计,需要将该配置删除,否则触发锚点会多触发 $pageview 事件
    is_track_viewDepth: true, // 浏览深度配置,默认打开
    is_track_timeOnPage: true, // 浏览时长配置,默认打开
    is_track_trackerKeyDom: false, // 是否开启约定拥有属性值为'tracker-key'的dom的点击事件自动上报,默认关闭
    page_time_interval: 2000, // 停留时长上报时间间隔,默认30s内每2s上报一次,30s-5min内每5s上报一次,5min以上10s上报一次
  });

  tracker.setUserId('9527');
</script>
  1. 方式 2 :模块化加载 从 npm 获取 sdk , npm install tezign-content-track
import TZContentTracker from 'tezign-content-sdk';

const tracker = new TZContentTracker({
  env: 'development', // 运行环境,非必填,默认 development
  tenant_id: 't2', // 租户id, 必填
  user_id: 'user_1234', // 用户id,非必填,可以在登录后调用setUserId进行设置
  is_track_single_page: true, // 单页面配置,默认开启,若页面中有锚点设计,需要将该配置删除,否则触发锚点会多触发 $pageview 事件
  is_track_viewDepth: true, // 浏览深度配置,默认关闭
  is_track_timeOnPage: true, // 浏览时长配置,默认关闭
  is_track_trackerKeyDom: false, // 是否开启约定拥有属性值为'tracker-key'的dom的点击事件自动上报,默认关闭
});

tracker.setUserId('9527');

SDK 基本配置

初始化参数

| 名称 | 类型 | 必填 | 描述 | | ---------------------- | ------- | ---- | --------------------------------------------------------------------------------------------- | | env | String | | 运行环境 'production' | 'development',默认'development' | | tenant_id | String | Y | 租户 id | | user_id | String | | 用户身份标识,当前系统唯一用户 id | | is_track_single_page | boolean | | 单页面配置,默认开启,若页面有锚点设计,需要将该配置删除,否则触发锚点会多触发 $pageview 事件 | | is_track_viewDepth | boolean | | 是否开启统计浏览深度,默认开启 | | is_track_timeOnPage | boolean | | 是否开启统计停留时长,默认开启 | | is_track_trackerKeyDom | boolean | | 是否开启约定拥有属性值为'tracker-key'的 dom 的点击事件自动上报,默认不开启 |

设置用户 id

tracker.setUserID('user1212112');