anchor-point-statistics

全平台用户行为统计,需要配合后端
3,704
Install
npm install anchor-point-statistics@1.0.49
Latest Version:1.0.49
Older releases:2
License:MIT
Last Updated:Nov 6, 2020
Links: GitHub  ·  npm
Maintainer: songjianet

anchor-point-statistics

使用TypeScript实现全平台用户行为统计,需要配合后端

安装

使用npm进行安装
npm install anchor-point-statistics
使用yarn进行安装
yarn add anchor-point-statistics

快速上手

在组件中引入:

import APS from 'anchor-point-statistics/dist/anchor-point-statistics.es5'

api

打开应用
const aps = new APS

aps.openApp({ 
  user_id: '' // 用户id
})
关闭应用
const aps = new APS

aps.closeApp({ 
  user_id: '' // 用户id
})
收藏商品
const aps = new APS

aps.collect({ 
  user_id: '', // 用户id
  product_id: '', // 商品id
  product_name: '' // 商品名称
})
取消收藏商品
const aps = new APS

aps.unCollect({ 
  user_id: '', // 用户id
  product_id: '', // 商品id
  product_name: '' // 商品名称
})
搜索商品
const aps = new APS

aps.unCollect({ 
  user_id: '', // 用户id
  keyword: '' // 搜索内容
})
浏览商品详情
const aps = new APS

aps.browse({
  user_id: '', // 用户id
  product_id: '', // 商品id
  product_name: '' // 商品名称
})
浏览商品列表
const aps = new APS

aps.browse({
  user_id: '', // 用户id
  product_name: 'name1/ name2/ name3' // 名称以/进行分割
})
浏览商品列表时间

浏览商品列表时间的实现方式是进入页面时调用一次api,退出页面时在调用一次api,进入页面可以搭配浏览商品列表使用,时间由sdk内部进行集成。

进入页面
const aps = new APS

// 配合浏览商品列表
aps.browse({
  user_id: '', // 用户id
  product_name: 'name1/ name2/ name3' // 名称以/进行分割
})

// 不配合商品列表
aps.browse({
  user_id: '' // 用户id
})
退出页面

uni-app的使用方式和传统node环境有所区别, uni-app在编译成小程序后, 页面退出的生命周期为onHide, 但是一个微信小程序归根到底是一个应用, 当用户直接用手机的任务管理器关闭小程序时onHide是无法进行监听, 所以应该使用onHide和onUnload。

const aps = new APS

onHide: function() {
  const aps = new APS
  aps.browse({
    user_id: this.userInfo.uid ? this.userInfo.uid : ''
  })
},

onUnload: function() {
  const aps = new APS
  aps.browse({
    user_id: this.userInfo.uid ? this.userInfo.uid : ''
  })
}
支付商品
const aps = new APS

aps.buy({
  user_id: '', // 用户id
  pay_type: 0, // 支付类型
  product_id: '', // 商品id
  product_name: '' // 商品名称
})
聚合支付商品
const aps = new APS

aps.buy({
  user_id: '', // 用户id
  pay_type: 0, // 支付类型
  product_name: "[{name: '商品名称', id: '商品id'}, {name: '商品名称', id: '商品id'}]"
})
退货
const aps = new APS

aps.returnPurchase({
  user_id: '', // 用户id
  product_id: '', // 商品id
  product_name: '' // 商品名称
})
聚合支付退货
const aps = new APS

aps.returnPurchase({
  user_id: '', // 用户id
  product_name: "[{name: '商品名称', id: '商品id'}, {name: '商品名称', id: '商品id'}]"
})

Related Packages

vue-ba

baidu analystics vue module

5,014
vue-uweb

A vuejs plugin for uweb statistics

2,087 166
@flux-ui/statistics

Statistics components for the Flux UI library.

19,564 12
nuxt-memwatch

Quickly watch real-time memory stats of your nuxt app

8,475

Version History

Version Released License
1.0.49 MIT
1.0.48 MIT
1.0.47 MIT
1.0.46 MIT
1.0.45 MIT