使用Google Analytics跟踪外部链接trackPageview()无效 [英] Tracking external links with Google Analytics trackPageview() not working
问题描述
根据 GA文档。
以下是相关网页: http://playmoreatthey.org/ - 页面上的外部链接被格式化,例如
< a href =http://www.ymcagreaterprovidence.org/Default.aspx?alias=www.ymcagreaterprovidence.org/baysidebranchonclick =javascript:pageTracker._trackPageview('/ G1 / bayside_family.com' ); target =_ blank> Bayside Family YMCA< / a>
我将目标设置为网址的首位匹配: /G1/bayside_family.com
四天后我检查了一下,并且目标或浏览量中没有关于页面名称的结果(/G1/bayside_family.com)在附加到每个外部链接的JavaScript中指定。
正在使用GA的异步样式代码 _gaq.push(...)
,但是在您的onclick中,您使用的是旧的传统样式代码。您需要使用 onclick =_ gaq.push(['_ trackPageview','/ G1 / bayside_family.com']) ;
I have set up external link tracking as Goals in Google Analytics according to the GA documentation.
Here is the page in question: http://playmoreatthey.org/ - the external links on the page are formatted such as
<a href="http://www.ymcagreaterprovidence.org/Default.aspx?alias=www.ymcagreaterprovidence.org/baysidebranch" onclick="javascript: pageTracker._trackPageview('/G1/bayside_family.com');" target="_blank">Bayside Family YMCA</a>
I set up the goal as a "head match" to the URL: /G1/bayside_family.com
I checked back four days later, and there are no results in the goals or pageviews for the phony "pagename" (/G1/bayside_family.com) specified in the JavaScript attached to each external link.
Looks like on your page you are using GA's async style code _gaq.push(...)
but in your onclick you are using their old, "traditional" style code. You need to use
onclick="_gaq.push(['_trackPageview','/G1/bayside_family.com']);"
这篇关于使用Google Analytics跟踪外部链接trackPageview()无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!