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

lz-wechat-piwik

v1.0.39

Published

微信小程序 埋点推送

Downloads

57

Readme

lz-wechat-piwik

Link your Piwik/Matomo installation

Installation

npm install --save lz-wechat-piwik

Usage

init


reportUrl:服务器发送地址
siteId:服务器站点id
 在你的页面所属JS中引入
 autoTrackPage:是否主动发请求,如果为true,就会在页面初始化onload中自动发送,建议为false

import Matomo from 'wechat-matomo'
Matomo.initTracker(reportUrl, siteId,  { autoTrackPage:false })

export default class extends wepy.app {
  config = {
    pages: [
      'pages/home/index',

through

/**
 *  页面初始化
 * eg:
 * 正常小程序页面会自动追踪page.onLoad页面事件进行上报
 *  Matomo.trackPageView(customTitle, pageUrl);
 * customTitle: 页面标题
 * pageUrl: 页面url

 */
Matomo.trackPageView("fafa", "fafda");

/**
 * 自定义事件追踪
 * eg:
 *  this.$parent.$wxapp.matomo.trackEvent('商城', '商品分享', '商品名称', 1)
 * category: 事件分类
 * action: 动作
 * name: 具体目标名称, 非必填
 * num: 事件动作的数值型参数,非必填,数值类型
 */
Matomo.trackEvent('category', 'action', 'name', num)

/**
 * 自定义页面搜索
 * 正常小程序页面会自动追踪page.onLoad页面事件进行上报,其他页面需手动上报
 * eg:
 *  Matomo.tracker.trackSiteSearch(keyword, category, resultsCount, customData);
 * keyword:搜索关键字
 * category:搜索类别
 * resultsCount:搜索次数
 * 
 */
Matomo.tracker.trackSiteSearch(keyword, category, resultsCount);

/**
 * 追踪商品下订单
 * 正常小程序页面会自动追踪page.onLoad页面事件进行上报,其他页面需手动上报
 * eg:
 *  Matomo.tracker.trackEcommerceOrder(orderId, grandTotal, subTotal, tax, shipping, discount);
 * orderId:订单号
 * grandTotal:事务的总收入(包括税、运费等)
 * subTotal:小计金额,通常是此订单中所有项目的项目价格总和(应用税前和运费)
 * tax:此订单的税额
 * shipping:)此订单的装运金额
 * discount:此订单中的折扣金额
 */
Matomo.tracker.trackEcommerceOrder(orderId, grandTotal, subTotal, tax, shipping, discount);


/**
 * 添加商品
 * 正常小程序页面会自动追踪page.onLoad页面事件进行上报,其他页面需手动上报
 * eg:
 * Matomo.tracker.addEcommerceItem(sku, name, category, price, quantity);
  * * sku:商品id
 * name:商品名称
 * category:商品分类
 * price:商品单价
 * quantity:)购买商品数量
 */
Matomo.tracker.addEcommerceItem(sku, name, category, price, quantity);

For available operations see the matomo api docs

License

MIT