我如何从Google Analytics获取原始日志? [英] How do I get raw logs from Google Analytics?

查看:306
本文介绍了我如何从Google Analytics获取原始日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从Google Analytics获取原始日志?有没有可以从GA生成原始日志的工具?

Is it possible to obtain raw logs from Google Analytic? Is there any tool that can generate the raw logs from GA?

推荐答案

否,您无法获取原始日志,但有没有什么能够阻止您获取记录到您自己的Web服务器日志中的完全相同的数据。查看 Urchin代码并借用它,将以下两行更改为指向您的网络服务器。

No you can't get the raw logs, but there's nothing stopping you from getting the exact same data logged to your own web server logs. Have a look at the Urchin code and borrow that, changing the following two lines to point to your web server instead.

var _ugifpath2="http://www.google-analytics.com/__utm.gif";
if (_udl.protocol=="https:") _ugifpath2="https://ssl.google-analytics.com/__utm.gif";

您需要创建 __ utm.gif

You'll want to create a __utm.gif file so that they don't show up in the logs as 404s.

显然,您需要将变量从命中中解析到您的Web服务器日志中。 Apache中的日志行看起来像这样。您将有很多乐趣解析出您想要的所有内容,但Google Analytics从基本JavaScript标记中获得的所有内容都是这样。

Obviously you'll need to parse the variables out of the hits into your web server logs. The log line in Apache looks something like this. You'll have lots of "fun" parsing out all the various stuff you want from that, but everything Google Analytics gets from the basic JavaScript tagging comes in like this.

127.0.0.1 - - [02/Oct/2008:10:17:18 +1000] "GET /__utm.gif?utmwv=1.3&utmn=172543292&utmcs=ISO-8859-1&utmsr=1280x1024&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=9.0%20%20r124&utmdt=My%20Web%20Page&utmhn=www.mydomain.com&utmhid=979599568&utmr=-&utmp=/urlgoeshere/&utmac=UA-1715941-2&utmcc=__utma%3D113887236.511203954.1220404968.1222846275.1222906638.33%3B%2B__utmz%3D113887236.1222393496.27.2.utmccn%3D(organic)%7Cutmcsr%3Dgoogle%7Cutmctr%3Dsapphire%2Btechnologies%2Bsite%253Arumble.net%7Cutmcmd%3Dorganic%3B%2B HTTP/1.0" 200 35 "http://www.mydomain.com/urlgoeshere/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.2.153.1 Safari/525.19"

这篇关于我如何从Google Analytics获取原始日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆