我是一个新的owa(Open Web Analytics)用户,我在/ owa / apache / htdocs / owa中安装了owa 并使用打击内容在/ owa / apache / htdocs下创建一个index.html 但是,在我多次刷新index.html后,我将无法看到owa的任何分析统计信息
<html>
<header>
<!– Start Open Web Analytics Tracker –>
<script type=”text/javascript”>
//<![CDATA[
var owa_baseUrl = 'http://localhost/owa/';
var owa_cmds = owa_cmds || [];
owa_cmds.push(['setSiteId', '4f9312bd29c7edd4d492210b8599a383']);
owa_cmds.push(['trackPageView']);
owa_cmds.push(['trackClicks']);
owa_cmds.push(['trackDomStream']);
(function() {
var _owa = document.createElement(‘script’); _owa.type = ‘text/javascript’; _owa.async = true;
owa_baseUrl = (‘https:’ == document.location.protocol ? window.owa_baseSecUrl || owa_baseUrl.replace(/http:/, ‘https:’) : owa_baseUrl );
_owa.src = owa_baseUrl + ‘modules/base/js/owa.tracker-combined-min.js’;
var _owa_s = document.getElementsByTagName(‘script’)[0]; _owa_s.parentNode.insertBefore(_owa, _owa_s);
}());
//]]>
</script>
<!– End Open Web Analytics Code –>
</header>
<body>
<h1>It works!</h1>
</body>
</html>
答案 0 :(得分:-1)
您的HTML存在一些问题。例如,您需要为html标记指定doctype。另外,应该是。
我已经清理了你的代码,但没有检查是否有效。尽管如此:
<!DOCTYPE html>
<head>
<title>Blah</title>
<script>
//<![CDATA[
var owa_baseUrl = 'http://localhost/owa/';
var owa_cmds = owa_cmds || [];
owa_cmds.push(['setSiteId', '4f9312bd29c7edd4d492210b8599a383']);
owa_cmds.push(['trackPageView']);
owa_cmds.push(['trackClicks']);
owa_cmds.push(['trackDomStream']);
(function() {
var _owa = document.createElement('script'); _owa.type = 'text/javascript'; _owa.async = true;
owa_baseUrl = ('https:' == document.location.protocol ? window.owa_baseSecUrl || owa_baseUrl.replace(/http:/, 'https:') : owa_baseUrl );
_owa.src = owa_baseUrl + 'modules/base/js/owa.tracker-combined-min.js';
var _owa_s = document.getElementsByTagName('script')[0]; _owa_s.parentNode.insertBefore(_owa, _owa_s);
}());
//]]>
</script>
</head>
<body>
<h1>It works!</h1>
</body>
</html>