我正在寻找一种从Google Analytics(分析)中导出每个唯一身份访问者的方法。因此,访问者可以多次打开一个网站,我想导出一行,其中包含有关访问的一些信息,例如网站的平均时间,购买次数,平均订单金额等。
提前致谢。
最佳答案
Stefan,我建议为此使用customVariables。
只需确保在调用_trackPageview之前放置了此代码即可。
_gaq.push(['_setCustomVar',
1, // This custom var is set to slot #1.
'VisitorID', // Name of your CustomVar that will show up in Reports
'123456789', // ID of your visitors, you need to set this.
1 // Set the scope to visitor-level.
]);
棘手的部分可能是使用一致地实际获取访客ID。一种方法是实际使用与_utma cookie中的Google Analytics(分析)商店相同的访客ID(详细信息在this article中)。
完成此操作的完整代码如下:
var a = uGC(document.cookie, '__utma=', ';');
var id = a.split(".")
_gaq.push(['_setCustomVar', 1, 'VisitorID', id[1], 1]);
之后,您可以使用VisitorID作为主要维度来构建自定义报告,然后选择要查看的任何指标。只需使您使用维度/指标的正确和逻辑组合即可获取实际上有意义的数字(请参阅此brilliant article by Avinash Kaushik)。
关于google-analytics - Google Analytics(分析):导出每个访问者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19082879/