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

@qihoo/fx-mp

v0.0.1

Published

fenxi for 360 small program

Downloads

1

Readme

360分析-小程序

功能概述

分析接入小程序,主要用于自定义数据收集,帮助开发者、运营人员数据分析,进行小程序优化。

代码配置

需要小程序开发者修改项目脚本,以编程方式配置。

一、安装代码

需要安装npm包,命令如下:

npm install @qihoo/fx-mp

建议在项目中的 app.js 文件中引入

import mp from "@qihoo/fx-mp"

脚本会自动运行,自定义行为的触发,请按后面说明进行使用。

二、自定义事件

自定义事件分析支持灵活多维和近实时的用户行为分析,可以通过自定义事件触发进行上报,对用户在小程序内的行为做精细化跟踪。目前支持注册、表单类、付款事件。

  • 注册 在注册成功的回调中调用下面代码,即可发送注册成功的打点

    代码如下:

    _qha.register({
    	eid: '' /*用户id, 必填项*/
    })
  • 表单 在表单中提交后的回调中调用下面代码,即可发送提交成功的打点

    代码如下:

    _qha.form({
    	eid: xx   /*转化id, 必填项*/
    })
  • 付款 在付款成功后的回调中调用下面代码,即可发送付款成功的打点

    代码如下:

    _qha.payment({
    	eid: xx,   /*转化id, 必填项*/
    	pymny: xx, /*支付金额, 必填项*/
    	ptype: 1 /*类型:1小游戏,2网页, 必填项*/
    })

三、自定义点击

自定义点击主要针对页面中某些按钮,区域的点击量进行数据采集,便于开发者、运营人员进行数据分析。

_qha是全局变量,通过npm包的引入而创建,所以自定义点击的声明不得早于代码的执行。建议在app.js中onReady中声明,或者在target页面中的onReady中声明。

代码如下:

	_qha.setClickTarget({
	id: 'Target的ID', /*必填项, string*/
	name: '自定义事件名称' /* 必填项,主要用于数据分析,查看其转化数据*/
	})

对于页面中的下载按钮的点击次数的收集,例如下载按钮的id是download,事件名称定为下载转化,示例如下 _qha.setClickTarget({ id: 'download', name: '下载转化' })