3.9.7 • Published 5 years ago

wechat-matomo v3.9.7

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

wechat-matomo

// 模板消息类事件: // 二、三参数取值: 二: msgTemplateId=${msgTemplateId}, // 后端模板消息提供 三: shareFrom=${channelId(user_event.branch)},// 后端模板消息提供 this.$parent.$wxapp.matomo.trackEvent('msg', msgTemplateId=${msgTemplateId}, shareFrom=${channelId(user_event.branch)})

// 授权手机号事件: // 二、三参数取值: 1、模板消息:msgTemplateId=${msgTemplateId}, shareFrom=${channelId(user_event.branch)}, 参数取值规则与模板消息类一致 2、其他:default, default, 后期有其他类型参考模板消息扩展 this.$parent.$wxapp.matomo.trackEvent(auth_phone, ,)

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

3.9.7

5 years ago

3.9.6

5 years ago

3.9.5

5 years ago

3.9.4

5 years ago

3.9.3

5 years ago

3.9.2

5 years ago

3.9.1

5 years ago

3.9.0

5 years ago

3.8.9

5 years ago

3.8.8

5 years ago

3.8.7

5 years ago

3.8.6

5 years ago

3.8.4

5 years ago

3.8.3

5 years ago

3.8.2

5 years ago

3.8.1

5 years ago

3.8.0

5 years ago

3.7.9

5 years ago

3.7.8

5 years ago

3.7.7

5 years ago

3.7.6

5 years ago

3.7.5

5 years ago

3.7.4

5 years ago

3.7.3

5 years ago

3.7.2

5 years ago

3.7.1

5 years ago

3.7.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago