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

dfh-burial-point

v1.0.8

Published

dfh埋点sdk

Downloads

27

Readme

数据埋点

基于uni-app,支持点击、浏览、曝光

安装

npm install dfh-burial-point

引入

import dfh from 'dfh-burial-point';

注册埋点

注册埋点,埋点注册成功后,会在vue中注册一个$buriedPoint全局属性(如果不想用全局,初始化方法会返回埋点实例,自行处理),此函数中有所有埋点暴露的方法,例如:click

// main.js
export function createApp() {
  const app = createSSRApp(App);
  // 添加埋点
  const dfh_buried = dfh.setOptions({
    app,
    footprint: true,
    server_url:`http://*****/api/***`, // 数据上报地址
    defaultData: {     // 默认值
      s_app_version: '1.0.0',
    },
    request: axios || uni.request,  // 
    closed: process.env.NODE_ENV === 'development'
  });
  return {
    app,
  };
}

options说明

| 参数 | 说明 | 类型 | 可选值 | 默认值 | |---------- |-------------- |---------- |-------------------------------- |-------- | |server_url | 服务上报地址 | string | 必填 | - | |closed | 开发环境是否发送埋点 | Boolean | false:开启/true:关闭 | false | |footprint | 开启页面浏览埋点 | Boolean | false/true | false | |autoSendFootPrint | 页面浏览埋点是否自动发送,需开启页面浏览埋点 | Boolean | false/true | true | |request | 网络请求方法 | Function | uni-ap传入:uni.request | - | |defaultData | 默认埋点的数据 | - | - | -| |session_id | 会话ID | - | - | -|

路由meta配置

| 参数 | 说明 | 类型 | 可选值 | 默认值 | 必传 | |---------- |-------------- |---------- |------------------ |-------- | --- | |footprint_model | 开启页面浏览埋点后,单个页面埋点是否自动上报 | Boolean | false/true | false | 否 | |current_buried_point | 开启页面自动发送埋点后,关闭单个页面埋点上报 | Boolean | false/true | false | 否 | |page_id | 页面ID | - | - | -|是 | |page_name | 页面名称 | - | - | -|是 |

指令方式使用

v-buried-point="{ attr: '点击埋点发送'}"
v-buried-exposure = "{attr: '自动曝光发送'}"

:::

函数方式使用

点击

const { proxy }  = getCurrentInstance();
  proxy.$buriedPoint.click({ 
    event_name: 'channel',
    sss: '1121212',
    vbnvbnvbn: '塑料袋福建省地方'
  });

曝光

const { proxy }  = getCurrentInstance();
  proxy.$buriedPoint.exposure({ 
    event_name: 'channel',
    sss: '1121212',
    vbnvbnvbn: '塑料袋福建省地方'
  });

浏览

const { proxy }  = getCurrentInstance();
  proxy.$buriedPoint.browse({ 
    event_name: 'channel',
    sss: '1121212',
    vbnvbnvbn: '塑料袋福建省地方'
  });

路径后缀获取

路径后缀获取的信息,直接放在路由参数对象中,前提开始自动上报浏览埋点。(page_id、page_name、source_location_id),其中page_id、page_name配置在路由meta中即可,如果是webview,无法监控到路由变化,需要手动上传