Authored by xuqi

add web analysis code.Review by:@liangzhifeng

  1 +<!-- Google Tag Manager -->
  2 +<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  3 +<script>
  4 +var _hmt = _hmt || [];
  5 +(function() {
  6 + function async_load(){
  7 + (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  8 + new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  9 + j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  10 + '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  11 + })(window,document,'script','dataLayer','GTM-W958MG');
  12 + (function() {
  13 + var hm = document.createElement("script");
  14 + hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
  15 + hm.async = 1;
  16 + var s = document.getElementsByTagName("script")[0];
  17 + s.parentNode.insertBefore(hm, s);
  18 + })();
  19 + (function() {
  20 + var hm = document.createElement("script");
  21 + hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
  22 + hm.async = 1;
  23 + var s = document.getElementsByTagName("script")[0];
  24 + s.parentNode.insertBefore(hm, s);
  25 + })();
  26 + (function() {
  27 + var hm = document.createElement("script");
  28 + hm.src = "http://static.yohobuy.com/js/analytics/analysis.js";
  29 + hm.async = 1;
  30 + var s = document.getElementsByTagName("script")[0];
  31 + s.parentNode.insertBefore(hm, s);
  32 + })();
  33 + }
  34 + window.addEventListener('load', async_load, false);
  35 +})();
  36 +</script>
  37 +<script>
  38 + window._py = window._py||[];
  39 + window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']);
  40 + window._py.push(['domain','stats.ipinyou.com']);
  41 + window._py.push(['e','']);
  42 + if(typeof _goodsData!='undefined'){
  43 + window._py.push(['pi',_goodsData]);
  44 + }
  45 + -function(d){
  46 + var f = 'https:' == d.location.protocol;var c = d.createElement('script');c.type='text/javascript';c.async=1;
  47 + c.src=(f ? 'https' : 'http') + '://'+(f?'fm.ipinyou.com':'fm.p0y.cn')+'/j/t/adv.js';
  48 + var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h);
  49 + }(document);
  50 +</script>
  51 +<script src="http://static.yohobuy.com/js/v3/o_code.js?v=20150420" async="async"></script>
@@ -20,5 +20,6 @@ @@ -20,5 +20,6 @@
20 </script> 20 </script>
21 {{/if}} 21 {{/if}}
22 {{> layout/use}} 22 {{> layout/use}}
  23 + {{> layout/analysis}}
23 </body> 24 </body>
24 </html> 25 </html>
@@ -94,6 +94,34 @@ function getShoppingKey() { @@ -94,6 +94,34 @@ function getShoppingKey() {
94 return JSON.parse(c).k; 94 return JSON.parse(c).k;
95 } 95 }
96 96
  97 +//YAS统计代码
  98 +(function(w, d, s, j, f) {
  99 + var a = d.createElement(s);
  100 + var m = d.getElementsByTagName(s)[0];
  101 +
  102 + w.YohoAcquisitionObject = f;
  103 +
  104 + w[f] = function() {
  105 + w[f].p = arguments;
  106 + };
  107 +
  108 + a.async = 1;
  109 + a.src = j;
  110 + m.parentNode.insertBefore(a, m);
  111 +})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.13.6.3/yas.js', '_yas');
  112 +
  113 +(function() {
  114 + var uid = getUid();
  115 +
  116 + uid = uid === 0 ? '' : uid;
  117 +
  118 + window._ozuid = uid;//暴露ozuid
  119 +
  120 + if (window._yas) {
  121 + window._yas(1 * new Date(), '1.0.13.6.3', 'yohobuy_web', uid, '', '');
  122 + }
  123 +}());
  124 +
97 window.cookie = cookie; 125 window.cookie = cookie;
98 126
99 window.setCookie = setCookie; 127 window.setCookie = setCookie;