PageSourceSearch

https://www.dianxiaomi.com/static/amplitude/dxmReport.js?v=tl108.84

js dianxiaomi.com collected 2026-10-02 09:54:52 UTC 3,234 bytes, 124 lines download raw bytes

1
2/*
3* dxm-report 店小秘用户操作上报
4*
5* */
6var appids = {
7    dev: 'y940y0u8l54x4sh9q2fdxu2zb41mv9f8',
8    prod: 'fapsc5t4tcirfe63y5xc2n951nrezwb4',
9};
10
11var env = 'dev';
12// 通过URL判断生产环境
13if (location.href.indexOf('www.dianxiaomi.com') !== -1) {
14    env = 'prod';
15}
16
17/**
18 * 上报初始化
19
20 * ```
21 * amplitude.init(API_KEY, uid, pid, options)
22 * ```
23 *
24 * Optionally, a config object can be provided. Refer to https://amplitude.github.io/Amplitude-TypeScript/interfaces/Types.BrowserConfig.html
25 * for object properties.
26 */
27var amplitude = this.amplitude || {};
28try {
29    amplitude.init(appids[env], '', '', {
30        serverUrl: 'https://events.sellfox.com/events',
31    });
32
33}catch (e) {
34    //
35}
36(function($, document) {
37    /**
38     * 设置上报的一些基础字段 uid puid
39     */
40    var setReportConfig = function() {
41        // 获取puid 和 id
42        var userId = $('#userId').val()
43        var userPuid = $('#userPuid').val()
44        try {
45            amplitude.setUserId(userId);
46            amplitude.setParentId(userPuid);
47        }catch (e) {
48            //
49        }
50    }
51    var monitorCountReport = function(name, extOpt) {
52        try {
53            var trackObj = Object.assign({
54                name: name,
55                url: window.location ? window.location.href : '',
56            }, extOpt)
57            amplitude.track(
58                'count',
59                trackObj,
60                {
61                    app_version: '0.0.0',
62                }
63            );
64        } catch (e){
65            //
66        }
67    }
68
69    /**
70     * 用户行为上报点击
71     * @param {*} name 事件名称
72     * @param {*} eventType 事件类型,默认是点击类型
73     * @param {*} extOpt 事件扩展属性
74     */
75    var userEventsReport = function(name, eventType, extOpt) {
76        try {
77            eventType = eventType ? eventType : 'click';
78            var trackObj = Object.assign({
79                name: name,
80                url: window.location ? window.location.href : '',
81            }, extOpt)
82            amplitude.track(
83                eventType,
84                trackObj,
85                {
86                    app_version: '0.0.0',
87                }
88            );
89        } catch (e) {
90            monitorCountReport('userEventsReportError');
91        }
92    }
93
94    // 只上报正式环境的错误
95    if (env === 'prod') {
96        // 收集主线程错误
97        // window.addEventListener('error', function (event) {
98        //     monitorCountReport('[error]' + event.message);
99        // });
100
101        // 收集异步事件错误
102        // window.addEventListener('unhandledrejection', function(event) {
103        //     monitorCountReport('[unhandledrejection]' + event.reason);
104        // });
105    }
106
107    // 初始化
108    $(document).ready(function() {
109        // 初始化上报基础数据
110        setReportConfig();
111    })
112
113    // 扩展输出
114    $.fn.extend( {
115        dxmEventsReport: function(name, eventType, options) {
116            userEventsReport(name, eventType, options)
117        },
118        dxmMonitorReport: function (msg, data) {
119            if(msg) {
120                monitorCountReport(msg, data)
121            }
122        }
123    })
124})(jQuery, document)

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.