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

cicada-wechat-matomo

v3.9.7

Published

piwik、matomo微信小程序客户端,from matomo js-sdk 3.7.0

Downloads

6

Readme

wechat-matomo

npm

Link your Piwik/Matomo installation

Installation

npm install --save wechat-matomo

Usage

init


/**
 * 注意初始化动作需要再 app class 执行之前初始化,否则无法自动追踪App生命周期事件
 *    trackerApiUrl:
 *      生产:待定
 *      测试:http://172.18.62.201:7080/piwik.php
 *    siteId:
 *      生产:待定,每个应用申请一个
 *      测试:1
 */
app.js

import mamoto from 'wechat-matomo'
const pageTitles = { // 页面标题翻译
  'pages/home/index': '页面标题1111',
   ……
}
matomo.initTracker(reportUrl, siteId, { pageTitles })

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

through

/**
 * 用户绑定
 * eg:
 *  this.$parent.$wxapp.matomo.setUserId(11123)
 */
this.$parent.$wxapp.matomo.setUserId(userId or email)

/**
 * 用户解绑, 小程序一般不需要
 * eg:
 *  this.$parent.$wxapp.matomo.resetUserId()
 */
this.$parent.$wxapp.matomo.resetUserId()  

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

/**
 * 自定义页面追踪
 * 正常小程序页面会自动追踪page.onLoad页面事件进行上报,其他页面需手动上报
 * eg:
 *  this.matomo.trackPageView('直播页', 'pages/plan/index')
 * customUrl: 自定义页面链接,与小程序页面path格式一致即可
 */
this.$parent.$wxapp.matomo.trackPageView(pageTile, customUrl)

For available operations see the matomo api docs

License

MIT