如何使用Google Analytics setAllowAnchor标志2

时间:2015-06-11 22:15:37

标签: javascript google-analytics

我的页面跟踪器下方有我的主播,但我没有看到我的广告系列被跟踪,这让我相信Google脚本在页面跟踪的第一部分正在进行页面跟踪。



var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-743349-4']);
_gaq.push(['_setDomainName', 'www.mitchellandmitchell.com']);
_gaq.push(['_setAllowLinker', true]);
_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><link rel="alternate" media="only screen and (max-width: 640px)" href="http://www.mitchellandmitchell.com/m/accountants_cpas/professional_liability.aspx" /><meta name="p:domain_verify" content="e79bbca85a3efe326151fff57604414c" />
<script>
    (function(f,b,g){
        var xo=g.prototype.open,xs=g.prototype.send,c;
        f.hj=f.hj||function(){(f.hj.q=f.hj.q||[]).push(arguments)};
        f._hjSettings={hjid:8476, hjsv:2};
        function ls(){f.hj.documentHtml=b.documentElement.outerHTML;c=b.createElement("script");c.async=1;c.src="//static.hotjar.com/c/hotjar-8476.js?sv=2";b.getElementsByTagName("head")[0].appendChild(c);}
        if(b.readyState==="interactive"||b.readyState==="complete"||b.readyState==="loaded"){ls();}else{if(b.addEventListener){b.addEventListener("DOMContentLoaded",ls,false);}}
        if(!f._hjPlayback &amp;&amp; b.addEventListener){
            g.prototype.open=function(l,j,m,h,k){this._u=j;xo.call(this,l,j,m,h,k)};
            g.prototype.send=function(e){var j=this;function h(){if(j.readyState===4){f.hj("_xhr",j._u,j.status,j.response)}}this.addEventListener("readystatechange",h,false);xs.call(this,e)};
        }
    })(window,document,window.XMLHttpRequest);
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-743349-4']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['customer._setAccount', 'UA-44882616-1']);
_gaq.push(['customer._setDomainName', 'none']);
_gaq.push(['customer._setAllowLinker', true]);
_gaq.push(['_setAllowAnchor', true]); 
_gaq.push(['customer._trackPageview']);
_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);
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

您的网页上存在一些语法错误。您应该加载开发人员工具并检查控制台是否存在这些错误。具体来说,他们是:

if(!f._hjPlayback &amp;&amp; b.addEventListener){

应该是

if(!f._hjPlayback && b.addEventListener){

和这一行

ga.src = ('https:' == document.location.protocol ? 'https://ssl';

应该是

ga.src = ('https:' == document.location.protocol ? 'https://ssl'

删除分号的地方。

可能这些错误打破了其他跟踪器的跟踪。