track.js 621 B

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