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

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

问题描述

是否可以从 Google Analytic 获取原始日志?有没有什么工具可以从 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 文件,以便它们不会在日志中显示为 404.

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

显然,您需要将点击中的变量解析到您的网络服务器日志中.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天全站免登陆