Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.Analytics = function() {
- // testflight
- if (Ti.Platform.osname !== 'android') {
- this.testflight = require("ti.testflight");
- this.testflight.token('teamtokengoeshere');
- Ti.API.debug("module is => " + this.testflight);
- }
- // Google
- Titanium.include('/lib/analytics.js');
- this.analytics = new Analytics('UA-XXXXXXX-XX');
- this.analytics.start(35);
- };
- exports.Analytics.prototype.trackPageview = function(pageName) {
- this.analytics.trackPageview(pageName);
- if (Ti.Platform.osname !== 'android') {
- this.testflight.checkpoint(pageName);
- }
- };
- exports.Analytics.prototype.trackAction = function(category, action, label, value) {
- this.analytics.trackPageview(category, action, label, value);
- if (Ti.Platform.osname !== 'android') {
- this.testflight.checkpoint('Action: '+category+'/'+action);
- }
- };
Add Comment
Please, Sign In to add comment