1(function() { 2 var sensors; 3 // ç¥çåæåå§å彿° 4 function initSensorsAnalytics() { 5 // ç¡®ä¿ç¥ç对象åå¨ 6 if (typeof window['sensorsDataAnalytic201505'] === 'undefined') { 7 console.error('ç¥çåæSDKæªå è½½'); 8 return; 9 } 10 11 var sensors = window['sensorsDataAnalytic201505']; 12 13 // ç¥çåå§åé ç½® 14 sensors.init({ 15 server_url: 'https://mdgj-sjdr.cast.org.cn/sa?project=production', 16 heatmap: { 17 scroll_notice_map: 'not_collect' 18 }, 19 is_track_single_page: false, // å¤é¡µé¢åºç¨è®¾ä¸ºfalse 20 use_client_time: true, 21 send_type: 'beacon', 22 show_log: true, 23 debug_mode: true, 24 25 }); 26 const wzdbValue = getDivValue(); 27 console.log(wzdbValue,'wzdbValue') 28 if(wzdbValue != null && wzdbValue !=''){ 29 sensors.registerPage({ 30 cdstm_tag: wzdbValue, 31 scene_name:"ä¸å½æ°åç§æé¦" 32 }); 33 } 34 // 注åå ¬å ±å±æ§ 35 sensors.registerPage({ 36 cdstm:"æ°åç§æé¦", 37 scene_name:"ä¸å½æ°åç§æé¦" 38 }); 39 // èªå¨éé页颿µè§äºä»¶ 40 sensors.quick('autoTrack'); 41 42 // èªå®ä¹é¡µé¢æµè§äºä»¶ï¼å¢å¼ºçï¼ 43 trackPageView(); 44 } 45 46function getDivValue() { 47 const divElement = document.getElementById('wzdb'); 48 if (!divElement) { 49 return ""; 50 } 51 52 // æ ¹æ®éæ±éæ©åéç屿§ 53 return divElement.textContent.trim(); // å»é¤é¦å°¾ç©ºæ ¼ 54} 55 // èªå®ä¹é¡µé¢æµè§äºä»¶è·è¸ª 56 function trackPageView() { 57 sensors = window['sensorsDataAnalytic201505']; 58 if (!sensors) return; 59 60 // è·å页é¢ä¿¡æ¯ 61 var pageInfo = { 62 '$url': window.location.href, 63 '$url_path': window.location.pathname, 64 '$title': document.title || 'æªè®¾ç½®æ é¢', 65 '$referrer': document.referrer || '', 66 '$timestamp': new Date().getTime() 67 }; 68 69 // åé页颿µè§äºä»¶ 70 sensors.track('$pageview', pageInfo); 71 72 // è°è¯ä¿¡æ¯ 73 if (window.console && console.log) { 74 console.log('ç¥ç页颿µè§äºä»¶å·²åé:', pageInfo); 75 } 76 } 77 78 // 页é¢å è½½å®æååå§å 79 if (document.readyState === 'loading') { 80 document.addEventListener('DOMContentLoaded', initSensorsAnalytics); 81 } else { 82 initSensorsAnalytics(); 83 } 84 85 // æä¾å ¨å±è®¿é®æ¹æ³ 86 window.SensorsAnalytics = { 87 // æå¨è§¦å页颿µè§äºä»¶ 88 trackPageView: trackPageView, 89 90 // ç¨æ·ç»å½å ³èæ¹æ³ 91 loginUser: function(openid) { 92 var sensors = window['sensorsDataAnalytic201505']; 93 if (sensors) { 94 // è®¾ç½®ç¨æ·ID 95 sensors.login('login_user_' + openid); 96 console.log('login_user_' + openid) 97 // è®°å½ç¨æ·ç»å½äºä»¶ 98 // sensors.track('user_login', { 99 // login_type: 'wechat', 100 // openid: openid 101 // }); 102 }}, 103 // èªå®ä¹äºä»¶è·è¸ª 104 trackEvent: function(eventName, properties) { 105 var sensors = window['sensorsDataAnalytic201505']; 106 if (sensors) { 107 sensors.track(eventName, properties); 108 } 109 }, 110 111 // è®¾ç½®ç¨æ·å±æ§ 112 setProfile: function(properties) { 113 var sensors = window['sensorsDataAnalytic201505']; 114 if (sensors) { 115 sensors.setProfile(properties); 116 } 117 } 118 }; 119})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.