2011-09-29 6 views
1

왜 내가 사용해야합니까 :왜 Google Analytics를 동적으로로드해야합니까?

<script type="text/javascript" charset="utf-8"> 
     //<![CDATA[ 
     var _gaq = _gaq || []; 
     _gaq.push(['_setAccount', 'xxxxxxxxxx']); 
     _gaq.push(['_trackPageview']); 
     _gaq.push(['_trackPageLoadTime']); 

     (function() { 
      var ga = document.createElement('script'); 
      ga.type = 'text/javascript'; 
      ga.async = true; 
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
      var s = document.getElementsByTagName('script')[0]; 
      s.parentNode.insertBefore(ga, s); 
     })(); 

     //]]> 
</script> 

대신

<script type="text/javascript" src="http://www.google-analytics.com/ga.js"></script> 
<script type="text/javascript" charset="utf-8"> 
     //<![CDATA[ 
     var _gaq = _gaq || []; 
     _gaq.push(['_setAccount', 'xxxxxxxxxx']); 
     _gaq.push(['_trackPageview']); 
     _gaq.push(['_trackPageLoadTime']);   
     //]]> 
</script> 

답변

2

의 :
+0

그래서 난이 수행 할 수 <스크립트 비동기를 = ""SRC = "http://www.google-analytics.com/ga.js"> 나 : <스크립트 비동기 = ""사실 SRC = "http://www.google-analytics.com/ga.js"> – user000001

관련 문제