track.js 606 B

123456789101112131415161718192021222324
  1. /**
  2. * @fileOverview track f2
  3. * @author sima.zhang1990@gmail.com
  4. */
  5. var Global = require('./global');
  6. var Util = require('./util/common');
  7. var SERVER_URL = 'https://kcart.alipay.com/web/bi.do';
  8. setTimeout(function () {
  9. if (Global.trackable && Util.isBrowser) {
  10. // Only works for H5 env
  11. var image = new Image();
  12. var newObj = {
  13. pg: document.URL,
  14. r: new Date().getTime(),
  15. f2: true,
  16. version: Global.version,
  17. page_type: 'syslog'
  18. };
  19. var d = encodeURIComponent(JSON.stringify([newObj]));
  20. image.src = SERVER_URL + "?BIProfile=merge&d=" + d;
  21. }
  22. }, 3000);