本文介绍了Google Analytics(分析) - 记录出站链接 - 打开新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已使用以下通过谷歌分析记录出站链接。是否可以在新窗口中打开链接?
I have used the following link to record outbound links through google analytics. Is it possible to open the link in a new window?
<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;">
推荐答案
编辑时,我忘了添加target =_ blank :
edit, I forgot to add target="_blank":
我会这样跟踪出站链接:
I would do it this way tracking outbound links:
<a href="http://outgoinglink.com" target="_blank" onclick="_gaq.push(['_trackEvent','outgoing_links','outgoinglink.com'])">Link Text</a>
这篇关于Google Analytics(分析) - 记录出站链接 - 打开新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!