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

sd-track-event

v0.1.38

Published

PV,UV,事件处理

Downloads

11

Readme

sd-track-event


安装使用


  npm install sd-track-event --save
  Vue.use(sdTrackEvent, {
    biz: 'cf', //cf, hz, sdb
    selfTag: storage.get('uuid')
    authorizationV2: xxx
  })

  切换路由使用:
  /*
    page_enter 页面访问事件
    click 单点击事件 用户单击某按钮或其他页面元素
    share 分享事件 分享动作发生时
    input 输入事件 用户在页面输入内容时
    api 接口调用事件
    swipe 滑动事件 手指在屏幕上滑动时会触发
    dialog 弹窗事件
    test 执行ABtest的操作打点
  */
  this.$sdTrackEvent.send({
    op: 'page_enter',
    fromPath: from.fullPath,
    subChannel: '',// 子渠道
    toPath: to.fullPath,
    pageName: to.name,// 页面名字
    channel: to.query.channel,
    testCode: to.query.grayMode,
    extInfo: {
      case_id: to.params.infoUuid || to.query.infoUuid
    }
  })

  点击事件绑定:
  <div v-sd-track="'ID'" data-test-flag="2" data-ext-info-test_test="test" .....></div>

  新增方法:
  // 获取上家用户的加密userid
  this.$sdTrackEvent.getUserSourceId()

  // 获取上家的分享ID
  this.$sdTrackEvent.getShareId()

  // 获取自己本次分享的Id
  this.$sdTrackEvent.getSelfShareId()

  // 生成分享链接所需要的参数并返回 如:userSourceId, shareId
  url = this.$sdTrackEvent.setShareParams(url) // www.shuidichou.com/cf/launch?userSourceId=xxxx&shareId=xxxx

Options

  selfTag: '',// 用户唯一标识
  biz: '',// 业务标识
  authorizationV2: '',// 登录票
  channel: '',// 渠道
  elementCode: '',// 事件ID
  testCode: '',// ABTEST标识
  platform: 'wx',// 什么平台
  subChannel: '',// 子渠道
  fromPath: '',// 从哪来
  toPath: '',// 到哪去
  extInfo: ''// 自定义字段