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

react-gio

v0.0.1

Published

react项目 gio 埋点

Downloads

1

Readme

项目介绍

安装

yarn add bnq-gio-web

npm install bnq-gio-web

使用

页面组件使用

  • 可以做浏览,曝光,点击事件
  • pageInTrack 开启埋点
  • 会自动需计算曝光,无需特殊处理(如实现componentDidHide,componentWillUnmount,componentDidShow)需要调用super对应方法

import {Gio, GioComponent} from 'bnq-gio-web';

export default class Index extends GioComponent { 

  componentDidMount() {
    super.pageInTrack()
  }

  componentDidShow() {
    super.componentDidShow();
  }

  componentDidHide() {
    super.componentDidHide();
  }

  onClick = () => {
    super.clickTrack({
      pageClickArea_var: '点击区域',
      pageClickPosition_var: `点击位置`,
      pageClickName_var: '事件名称',
      To_RetentionPage_var: false
    },'页面key');

    super.clickTrack2('点击区域', `点击位置`, '事件名称', '是否留资 非必传')
  }

  render() {
    return(<View >...</View>)
  }
}

Gio Api

相关API


/**
   * 初始化
   * @param config 项目配置
   * @param option 配置项
   */
Gio.init(config: GioConfig, option: InitOption);
  /**
   * 基础参数配置
   * @param option 配置项
   */
  Gio.baseConfig(option: BaseConfig, thrid?: ThridShare): void;

  /**
   * 公共参数配置
   * @param option 配置项/或具体配置项的key
   * @param value 配置项值,只有option为字符串时传值
   */
  Gio.config(option: ParamOptionConfig | ThridShare | string, value?: string): void;

  /**
   * 获取参数
   * @param value 获取配置类型;不传全部配置,'param': 参数配置,'base': 基础配置,
   */
  Gio.getConfig(value?: string): {
    param: ParamOptionConfig;
    base: BaseConfig;
    thrid: ThridShare;
  };

  /**
   * 获取所有配置
   */
  Gio.getConfigAll(): ParamOptionConfig & BaseConfig & ThridShare;

  /**
   * 设置埋点事件和事件级变量
   * 发送一个埋点事件。在添加所需要发送的事件代码之前,需要在平台中配置事件以及事件属性。
   *
   * @param event 必填;事件名/标识符
   * @param params 选填;事件属性,即事件发生时所伴随的维度信息参数
   */
  Gio.track(event: string, params: any, item?: TrackItem): void;
  /**
   * 设置埋点事件 -浏览
   * @param params 配置参数
   */
  Gio.browse(params: BrowseParam, item?: TrackItem): void;

  /**
   * 设置埋点事件 -曝光
   * @param key 事件名
   * @param timeCount 计时
   * 例:event,
   */
  Gio.expose(key: string, timeCount?: number, item?: TrackItem): void;

  /**
   * 设置埋点事件 -点击
   * @param key 事件名
   * @param params 点击参数
   */
  Gio.click(key: string, params: ClickParam, item?: TrackItem): void;

  // 点击事件
  Gio.click2(area: string, position: string, name: string, retention?: boolean, item?: any): void;

  /**
   * 获取版本号
   */
  Gio.getVersion(): string;