Google analytics pageTracker未使用Google Analytics中基于cookie的排除定义

Google analytics pageTracker未使用Google Analytics中基于cookie的排除定义,google-analytics,Google Analytics,接下来,在Google Analytics中过滤管理员流量 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> <head> <meta http-equi

接下来,在Google Analytics中过滤管理员流量

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Excluding traffic by Cookie Content</title>
<meta name=.robots. content=.noindex. />
<!-- Google Analytics Code -->
<script type="text/javascript">// <![CDATA[
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']); //use real profile ID here
  _gaq.push(['_trackPageview']);
  _gaq.push(['_trackPageLoadTime']);
  (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>
<!-- Google Analytics Code -->
</head>
<body onLoad="javascript:pageTracker._setVar('filter');">
<h1>Excluding traffic by Cookie Content</h1>
<p>This page will set a cookie in your browser that will help Google Analytics filter the traffic that comes from your computer when using this browser.</p>
<p>Once you have this setup, don't forget to set a filter in Google Analytics.</p>
<p>You will need to visit this page only once.</p>
<p>However, if you clear your browser cookies, reinstall the browser or operating system, make sure that you revisit this page, so the cookie will be set again.</p>
</body>
</html>

我上面所说的是正确的吗?

看起来你把传统风格的分析(
pageTracker.\u setVar…
)和异步风格的分析(
\u gaq.push…
)混为一谈了

您可以使用
\u gat.\u getTrackerByName()
获取跟踪器对象的副本--尝试在body onload中使用此选项:

_gat._getTrackerByName()._setVar('filter');

@mike是对的,我在混合技术,最后我使用了Async,因为它可以工作;)

var _gaq=_gaq | |[]; _gaq.push(['''u setAccount','UA-XXXXXXXX-X']); _gaq.push([''u trackPageview']); _gaq.push([''u setVar','trackme'])

(功能(){ var ga=document.createElement('script');ga.type='text/javascript';ga .async=true; ga.src=('https:'==document.location.protocol?'https://ssl“:”ht tp://www')+'.google analytics.com/ga.js'; var s=document.getElementsByTagName('script')[0];s.parentNode.i nsertBefore(ga,s); })();

_gat._getTrackerByName()._setVar('filter');