Guest User

Untitled

a guest
Jan 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. exports.Analytics = function() {
  2. // testflight
  3. if (Ti.Platform.osname !== 'android') {
  4. this.testflight = require("ti.testflight");
  5. this.testflight.token('teamtokengoeshere');
  6. Ti.API.debug("module is => " + this.testflight);
  7. }
  8.  
  9. // Google
  10. Titanium.include('/lib/analytics.js');
  11. this.analytics = new Analytics('UA-XXXXXXX-XX');
  12. this.analytics.start(35);
  13. };
  14.  
  15. exports.Analytics.prototype.trackPageview = function(pageName) {
  16. this.analytics.trackPageview(pageName);
  17. if (Ti.Platform.osname !== 'android') {
  18. this.testflight.checkpoint(pageName);
  19. }
  20. };
  21.  
  22. exports.Analytics.prototype.trackAction = function(category, action, label, value) {
  23. this.analytics.trackPageview(category, action, label, value);
  24. if (Ti.Platform.osname !== 'android') {
  25. this.testflight.checkpoint('Action: '+category+'/'+action);
  26. }
  27. };
Add Comment
Please, Sign In to add comment