@sbc-fe/x.analytics
v1.0.5
Published
analytics
Downloads
17
Readme
x.analytics.js 统计分析记录
Web
<script src="../lib/x.analytics.min.js"></script>
<script>
// console.log(window.xa)
xa.adapter(function(data, query) {
console.log(data);
var img = new Image();
img.src = 'http://test.com/analytics?'+ query;
});
xa('create', 'test-1', 'auto');
xa('send', 'pageview');
</script>
Vue
// main.js
import Vue from 'vue'
import XA from '@sbc-fe/x.analytics'
XA.adapter(function(data, query) {
console.log(data);
var img = new Image();
img.src = 'http://test.com/analytics?'+ query;
});
Vue.prototype.$xa = XA
// component
this.$xa('create', 'test-1', 'auto');
this.$xa('send', 'pageview');
uni-app
// main.js
import XA from '@sbc-fe/x.analytics'
XA.adapter(function(data, query) {
console.log(data);
var img = new Image();
img.src = 'http://test.com/analytics?'+ query;
});
uni.xa = XA;
uni.xa('create', 'test-1', 'auto');
uni.xa('send', 'pageview');