google 用户时间分析
google analytic for user timing
我想跟踪用户时间,但我这边不工作,请检查下面的跟踪代码,可以吗?
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UX-XXXXXXX-1']);
_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);
})();
_gaq.push(['_trackTiming', 'jQuery', 'Load Library',23222, 'Google CDN']);
默认 Google samples the data, and the default is 1%。 IOW 你需要为 Google 获得 100 次点击才能从中抽取 1 个随机点击。
您可以在 link 中提到的 _setSiteSpeedSampleRate
提高全局级别的采样率,或者如果您只想提高 _trackTiming
的采样率,则有可选的第 5 个参数,例如
// sample 100%
_gaq.push(['_trackTiming', 'jQuery', 'Load Library', 23222, 'Google CDN', 100]);
另请注意,数据最多需要 24 小时才能显示出来,并请注意每次点击都计入每位访问者会话 500 次点击的限制。
旁注: 第三个参数是加载内容所花费的时间,以毫秒为单位。 23222
只是您为了 posting/testing 而设置的随机数,还是 jQuery 真的需要那么长时间才能加载?因为该死的...
我想跟踪用户时间,但我这边不工作,请检查下面的跟踪代码,可以吗?
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UX-XXXXXXX-1']);
_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);
})();
_gaq.push(['_trackTiming', 'jQuery', 'Load Library',23222, 'Google CDN']);
默认 Google samples the data, and the default is 1%。 IOW 你需要为 Google 获得 100 次点击才能从中抽取 1 个随机点击。
您可以在 link 中提到的 _setSiteSpeedSampleRate
提高全局级别的采样率,或者如果您只想提高 _trackTiming
的采样率,则有可选的第 5 个参数,例如
// sample 100%
_gaq.push(['_trackTiming', 'jQuery', 'Load Library', 23222, 'Google CDN', 100]);
另请注意,数据最多需要 24 小时才能显示出来,并请注意每次点击都计入每位访问者会话 500 次点击的限制。
旁注: 第三个参数是加载内容所花费的时间,以毫秒为单位。 23222
只是您为了 posting/testing 而设置的随机数,还是 jQuery 真的需要那么长时间才能加载?因为该死的...