此行可以在Google Analytics 自定义变量文档中找到
您最多可以同时使用 5 个自定义变量用于单个请求(例如网页浏览或事件调用)。在任何给定请求中,所有自定义变量的总和不能超过 5(即,您不能同时设置 5 个访问者和 5 个会话自定义变量)。
这是 javascript/beacon 的限制和/或 GA 在免费版本的 Google Analytics 中汇总事件的方式的限制吗?
用代码改写,如果我使用的是支付 GA Premium 的帐户,这会起作用吗?
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_setCustomVar', 1, 'Foo', "Bar", 1]);
_gaq.push(['_setCustomVar', 2, 'Biz', "Baz", 2]);
_gaq.push(['_setCustomVar', 3, 'Ugg', "Bot", 3]);
_gaq.push(['_setCustomVar', 4, 'Big', "Bug", 1]);
_gaq.push(['_setCustomVar', 5, 'Sun', "Tin", 2]);
_gaq.push(['_setCustomVar', 6, 'Hor', "Ton", 3]);
_gaq.push(['_setCustomVar', 7, 'Saw', "Who", 1]);
_gaq.push(['_setCustomVar', 8, 'Dis', "Dat", 2]);
_gaq.push(['_setCustomVar', 9, 'Who', "Der", 3]);
_gaq.push(['_trackPageview']);
_gaq.push(["_trackEvent", "cat", "action", "lbl", 0, true]);
或者我是否必须像这样构造上面的代码:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_setCustomVar', 1, 'Foo', "Bar", 1]);
_gaq.push(['_setCustomVar', 2, 'Biz', "Baz", 2]);
_gaq.push(['_setCustomVar', 3, 'Ugg', "Bot", 3]);
_gaq.push(['_setCustomVar', 4, 'Big', "Bug", 1]);
_gaq.push(['_setCustomVar', 5, 'Sun', "Tin", 2]);
_gaq.push(['_trackPageview']);
_gaq.push(['_setCustomVar', 6, 'Hor', "Ton", 3]);
_gaq.push(['_setCustomVar', 7, 'Saw', "Who", 1]);
_gaq.push(['_setCustomVar', 8, 'Dis', "Dat", 2]);
_gaq.push(['_setCustomVar', 9, 'Who', "Der", 3]);
_gaq.push(["_trackEvent", "cat", "action", "lbl", 0, true]);