> Zencart中文手册 > zencart模板怎么添加Google的跟踪代码

zencart模板怎么添加Google的跟踪代码 
  在/includes/templates/pure_orange/common/这个目录下有个tpl_main_page.PHP中,在其中的</body>前面加上Google的代码
<script type=”text/javascript”>
var gaJsHost = ((”https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(”%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
try{
var pageTracker = _gat._getTracker(”UA-xxxxxx-x”);
pageTracker._trackPageview();
} catch(err) {}
</script>