PageSourceSearch

https://cdstm.cn/cms_files/filemanager/396489973/script/202511/C7169955D9E75693CA0B23347814B670.js?v=1

js cdstm.cn collected 2026-09-24 09:36:35 UTC 3,781 bytes, 119 lines download raw bytes

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.