此Google Analytics代碼無效。我看不到任何訪客,並且事件不會被觸發。有任何想法嗎?謝謝。Google Analytics代碼無效
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<!-- <META HTTP-EQUIV="Refresh" CONTENT="2;URL=http://www.example.com"> -->
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Example</title>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-99999999-1']); // Hidden my real one
_gaq.push(['_trackPageview']);
(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>
</head>
<body>
<script type="text/javascript">
_gaq.push(['_trackEvent', 'My Event', 'Hypothesis', 'Email', 1]);
window.location = "http://www.example.com";
</script>
</body>
</html>
如果您剛剛放入,則需要一段時間才能顯示。 另外,請檢查Firefox/Chrome錯誤控制檯中的錯誤,如果發現錯誤,請將它們放在這裏。 – codefreak
即使使用「實時」功能? – Arturo
不確定它是否立即開始提供實時信息,但根據http://smallbusinessshift.com/guides/google-analytics/ 「Google Analytics(分析)需要一段時間才能開始接收數據」。因此,您可能應該稍等片刻或檢查其他js錯誤 – codefreak