如the official documentation中所述,我在<head>
部分中包含了这段代码:
<script type="text/javascript">
function recordOutboundLink(link, category, action) {
try {
var myTracker=_gat._getTrackerByName();
_gaq.push(['myTracker._trackEvent', category , action ]);
setTimeout('document.location = "' + link.href + '"', 100)
}catch(err){}
}
</script>
并改变了与此相关的链接:
<a href="http://www.example.com" onClick="recordOutboundLink(this, 'Outbound Links', 'example.com');return false;">
但报告中仍未显示任何事件。
我做错了什么?
答案 0 :(得分:1)
Google Analytics文档中的代码不正确。 <head>
部分中的代码应为
<script type="text/javascript">
function recordOutboundLink(link, category, action) {
try {
_gaq.push(['_trackEvent', category , action ]);
setTimeout('document.location = "' + link.href + '"', 100)
}catch(err){}
}
</script>