analysis.hbs 3.07 KB
<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);
    }(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.4.8/yas.js', '_yas'));

    var _hmt = _hmt || [];

    (function() {
        function getUid() {
            var uid,
                name = '_UID',
                cookies = (document.cookie && document.cookie.split(';')) || [];

            for (var i = 0; i < cookies.length; i++) {
                if (cookies[i].indexOf(name) > -1) {
                    uid = decodeURIComponent(cookies[i].replace(name + '=', '').trim());
                    break;
                }
            }

            if (!uid) return 0;

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

        function queryString() {
            var vars = {},
                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;

        uid = uid === 0 ? '' : uid;
        window._ozuid = uid; // 暴露ozuid
        if (window._yas) {
            window._yas(1 * new Date(), '2.4.8', 'yohobuy_m', uid, '', '');
        }

        setTimeout(function() {
            {{#if @root.isLogin}}
                {{#if @root.isApp}}
                _hmt.push(['_setCustomVar', 3, 'login', 'APP', 2]);
                {{^}}
                _hmt.push(['_setCustomVar', 3, 'login', 'H5', 2]);
                {{/if}}
            {{/if}}
            (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);
            })();
            {{!-- (function() {
                var hm = document.createElement("script");
                hm.src = "https://hm.baidu.com/hm.js?e5b83a487a4458aa5abca43f5779b764";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })(); --}}
        }, 1000);
    }());

    window._fxcmd = window._fxcmd || [];
    _fxcmd.sid = 'bb3b16fa1106a6ab8619da0095755f32';
    _fxcmd.trackAll = false;

    setTimeout(function() {
        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);
    }, 1000);


</script>