You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.2KB

  1. ;(function (para) {
  2. var p = para.sdk_url,
  3. n = para.name,
  4. w = window,
  5. d = document,
  6. s = 'script',
  7. x = null,
  8. y = null
  9. if (typeof w['sensorsDataAnalytic201505'] !== 'undefined') {
  10. return false
  11. }
  12. w['sensorsDataAnalytic201505'] = n
  13. w[n] =
  14. w[n] ||
  15. function (a) {
  16. return function () {
  17. ;(w[n]._q = w[n]._q || []).push([a, arguments])
  18. }
  19. }
  20. var ifs = [
  21. 'track',
  22. 'quick',
  23. 'register',
  24. 'registerPage',
  25. 'registerOnce',
  26. 'trackSignup',
  27. 'trackAbtest',
  28. 'setProfile',
  29. 'setOnceProfile',
  30. 'appendProfile',
  31. 'incrementProfile',
  32. 'deleteProfile',
  33. 'unsetProfile',
  34. 'identify',
  35. 'login',
  36. 'logout',
  37. 'trackLink',
  38. 'clearAllRegister',
  39. 'getAppStatus'
  40. ]
  41. for (var i = 0; i < ifs.length; i++) {
  42. w[n][ifs[i]] = w[n].call(null, ifs[i])
  43. }
  44. if (!w[n]._t) {
  45. w[n].para = para
  46. var scriptURLs = [
  47. 'plugins/session-event/index.js', //引用的session-event插件路径
  48. p
  49. ]
  50. function loadScript(index) {
  51. if (index >= scriptURLs.length) {
  52. return false
  53. }
  54. var x = d.createElement(s)
  55. y = d.getElementsByTagName(s)[0]
  56. x.async = 1
  57. x.src = scriptURLs[index]
  58. x.setAttribute('charset', 'UTF-8')
  59. x.onload = function () {
  60. loadScript(index + 1)
  61. }
  62. y.parentNode.insertBefore(x, y)
  63. }
  64. loadScript(0)
  65. }
  66. sensors.quick('isReady', function () {
  67. sensors.use('PageLeave', { heartbeat_interval_time: 5 })
  68. sensors.use('PageLoad')
  69. sensors.use('SessionEvent')
  70. })
  71. sensors.quick('autoTrackSinglePage')
  72. })({
  73. sdk_url: 'sensorsdata.js',
  74. name: 'sensors',
  75. show_log: true,
  76. is_track_single_page: true,
  77. send_type: 'beacon',
  78. server_url: 'http://10.249.9.2:8205/receiver/api/gp?project=zjslssxmglxt&token=3aFsbYHS7e3HKSiw0T3262ce22bfpNA3', //请修改接收地址为clklog_receiver 的接收服务地址,必须传入project和token参数
  79. heatmap: {
  80. clickmap: 'default',
  81. scroll_notice_map: 'default',
  82. collect_tags: {
  83. div: true,
  84. img: true
  85. }
  86. },
  87. preset_properties: { latest_referrer_host: true }
  88. })