track.js 618 B

12345678910111213141516171819202122
  1. /**
  2. * @fileOverview track f2
  3. * @author sima.zhang1990@gmail.com
  4. */
  5. import Global from './global';
  6. import { isBrowser } from './util/common';
  7. var SERVER_URL = 'https://kcart.alipay.com/web/bi.do';
  8. setTimeout(function () {
  9. if (Global.trackable && 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 = "".concat(SERVER_URL, "?BIProfile=merge&d=").concat(d);
  21. }
  22. }, 3000);