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

buried_point_common

v0.2.7

Published

> 埋点多版本通用方法插件 # buried_point_common ### 插件使用方法 #### 安装 buried_point_common ```shell npm install buried_point_common # NOTE: or yarn add buried_point_common ``` #### 全局引入 - vue2 ```js import buried from 'buried_point_common' Vue.use(buried) `

Downloads

4

Readme

埋点多版本通用方法插件

buried_point_common

插件使用方法

安装 buried_point_common

npm install buried_point_common
# NOTE: or
yarn add buried_point_common

全局引入

  • vue2
import buried from 'buried_point_common'
Vue.use(buried)
  • vue3
import buried from 'buried_point_common'
app.use(buried)

埋点参数标准

行为列表

参数统一建议

// FIXME: 建议
- 存储到vuex中的参数:
{
	client_version,action_type,user_type
}
- 当前页面变动参数
{
	user_id
}
- 需要单独设置的参数
{
	action_id,
}
- 封装方法导出的参数
{
	connection_id,current_view_id,event_id,arise_time
}
- 扩展参数
 {
	phone_num,product_name,product_id,source_platform,advertising
 }

参数进行assign即可,目前的常量参数没有进行封装,后面可以进行代码级的优化

优化建议

  • 常量参数封装
  • 方法参数统一
  • 指令和全局函数使用
  • 埋点添加标识

页面使用

  • vue2
// HACK: 埋点节点 根据实际业务进行更改
<input v-track="params"/>
<button @clicl="buried">click埋点节点</button>
export default {
	data(){
		return {
			//HACK: 参数请根据埋点参数标准进行配置 此处请根据实际业务进行参数配置
			params:{
				event_id: 'params_event_id',
				action_id: 'params_action_id',
				action_type: 'params_action_type',
				user_type: 'params_user_type',
				user_id: 'params_user_id',
			}
		}
	},
	methods:{
		 methods: {
			buried() {
			this.$track(this.params);
		},
	}
}
  • vue3
// HACK: 埋点节点 根据实际业务进行更改
<input v-track="params"/>
<button @clicl="buried">click埋点节点</button>
import { getCurrentInstance ,reactive} from "vue";
const { proxy, appContext } = getCurrentInstance();
const globalProxy = appContext.config.globalProperties;
// HACK: 参数请根据埋点参数标准进行配置
const params = reactive({
       			event_id: 'params_event_id',
				action_id: 'params_action_id',
				action_type: 'params_action_type',
				user_type: 'params_user_type',
				user_id: 'params_user_id',
})
let buried = () => {
  globalProxy.$track(params);
};

环境变量

  • vue2
# NOTE:  vue2 默认配置
VUE_APP_MODE = dev

VUE_APP_PROXY_URL = "https://api-test.ennejb.cn"

VUE_APP_BASE_URL = "/news"

VUE_APP_URL = "/activity_h5"
  • vue3
# NOTE:  vite 默认配置
NODE_ENV = 'dev'

VITE_APP_MODE = dev

VITE_APP_PROXY_URL = "https://api-test.ennejb.cn"

VITE_APP_BASE_URL = "/news"

VITE_APP_URL = "/activity_h5"

暴露方法和指令

1、全局挂载指令 v-track="trackData"

2、暴露全局方法 $track(this.trackData);

特殊说明

埋点函数地址为公司内部使用,仅限公司内部项目使用