Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

shineabel/cordova-umeng-analytics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

注意

请使用最新版本(完全可用) https://github.com/shineabel/cordova-plugin-umeng-analytics

cordova-umeng-analytics

Cordova友盟统计插件 请使用v1.0.0版本解决了cordova iOS构建时的"UMMobClick/MobClick.h" not found错误

安装

运行 cordova plugin add https://github.com/shineabel/cordova-umeng-analytics

使用方法

请务必在cordova ready中调用配置接口

配置API

Umeng.Analytics.config({
    appkey: 'your_app_key', 
    channel: 'your_channel'
}, function () {
    console.log("umeng init success");
}, function (err) {
    console.error("umeng init failed",err);
});

开始记录页面停留

Umeng.Analytics.startPage('xxxPage', 
function () {
    alert("Success");
}, function (reason) {
    alert("Failed: " + reason);
});

结束记录页面停留

Umeng.Analytics.endPage('xxxPage', function () {
   alert("Success");
}, function (reason) {
   alert("Failed: " + reason);
});

自定义事件

Umeng.Analytics.logEvent({
    eventId: 'pay',
    attributes: {book:'Swfit Fundamentals'},
    num: 110
}, function () {
    alert("Success");
}, function (reason) {
alert("Failed: " + reason);
});

打开或关闭调试

Umeng.Analytics.setDebug(true, function () {
   alert("Success");
}, function (reason) {
   alert("Failed: " + reason);
});

About

Cordova 友盟统计插件

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 85.2%
  • Java 12.0%
  • JavaScript 2.8%