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">
var pageTracker = _gat._getTracker("UA-xxxxxxx-x");//这个是你自己的用户编码,修改成你自己的就可以了
pageTracker._initData();
pageTracker._trackPageview();
</script> <?php
// End Analytics tracking code
?>
然后把此文件上传到网站目录,然后在模版文件中添加此文件,就可以了。例子如下:
<html>
<?php include ("header.php"); ?>
<body>
<?php include ("sideNav.php"); ?>
<?php include ("main.php"); ?>
<?php include ("analyticsTracking.php"); ?>
</body>
</html>
如果你想找到现有的配置文件,在设置页面点击修改,转到配置文件设置页面,点检查状态就可以了。