Blame view

doraemon/views/partial/analysis.hbs 3.15 KB
沈志敏 authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<script>
    (function(w, d, s, j, f) {
        var a = d.createElement(s);
        var m = d.getElementsByTagName(s)[0];

        w.YohoAcquisitionObject = f;

        w[f] = function() {
            w[f].p = arguments;
        };

        a.async = 1;
        a.src = j;
        m.parentNode.insertBefore(a, m);
郝肖肖 authored
15
    }(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.4.11/yas.js', '_yas'));
沈志敏 authored
16
17 18
    var _hmt = _hmt || [];
沈志敏 authored
19
    (function() {
沈志敏 authored
20 21 22 23 24
        function getUid() {
            var uid,
                name = '_UID',
                cookies = (document.cookie && document.cookie.split(';')) || [];
郭成尧 authored
25 26 27 28
            for (var i = 0; i < cookies.length; i++) {
                if (cookies[i].indexOf(name) > -1) {
                    uid = decodeURIComponent(cookies[i].replace(name + '=', '').trim());
                    break;
沈志敏 authored
29
                }
郭成尧 authored
30
            }
沈志敏 authored
31 32 33 34 35 36 37 38 39 40 41

            if (!uid) return 0;

            uid = uid.split('::');
            if (!uid || uid.length < 4) {
                return 0;
            }
            return uid[1];
        }

        function queryString() {
沈志敏 authored
42
            var vars = {},
沈志敏 authored
43 44 45 46 47 48 49 50 51 52 53 54
                hash,
                i;
            var hashes = window.location.search.slice(1).split('&');

            for (i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars[hash[0]] = hash[1];
            }
            return vars;
        }

        var uid = getUid() || queryString().uid;
沈志敏 authored
55 56 57 58

        uid = uid === 0 ? '' : uid;
        window._ozuid = uid; // 暴露ozuid
        if (window._yas) {
郝肖肖 authored
59
            window._yas(1 * new Date(), '2.4.11', 'yohobuy_m', uid, '', '');
沈志敏 authored
60
        }
61
62
        setTimeout(function() {
郭成尧 authored
63 64 65 66 67 68 69
            {{#if @root.isLogin}}
                {{#if @root.isApp}}
                _hmt.push(['_setCustomVar', 3, 'login', 'APP', 2]);
                {{^}}
                _hmt.push(['_setCustomVar', 3, 'login', 'H5', 2]);
                {{/if}}
            {{/if}}
70 71 72 73 74 75
            (function() {
                var hm = document.createElement("script");
                hm.src = "https://hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();
毕凯 authored
76 77 78 79 80 81 82

            (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
            new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
            'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
            })(window,document,'script','dataLayer','GTM-W958MG');
83
        }, 1000);
沈志敏 authored
84
    }());
郭成尧 authored
85
郭成尧 authored
86
    window._fxcmd = window._fxcmd || [];
郭成尧 authored
87 88
    _fxcmd.sid = 'bb3b16fa1106a6ab8619da0095755f32';
    _fxcmd.trackAll = false;
郭成尧 authored
89 90

    setTimeout(function() {
郭成尧 authored
91 92 93 94 95 96
        var _pzfx = document['createElement']('script');
        _pzfx.type = 'text/javascript';
        _pzfx.async = true;
        _pzfx.src = '//static.w3t.cn/fx/1/1/fx.js';
        var sc = document.getElementsByTagName('script')[0];
        sc.parentNode.insertBefore(_pzfx,sc);
郭成尧 authored
97
    }, 1000);
毕凯 authored
98
郭成尧 authored
99
沈志敏 authored
100 101
</script>