Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get raw logs from Google Analytics?

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

like image 413
Ravi Chhabra Avatar asked Sep 12 '08 11:09

Ravi Chhabra


People also ask

Can we extract data from Google Analytics?

Manual export of Google Analytics dashboard You select the GA report you want to export. Then you click the “Export” button and choose the desired format. A few moments later, your GA data will be downloaded to your device.

Can you download reports from Google Analytics?

Export a reportClick in the top right of most reports. Click Download File. Select an option: Download PDF.

How do I extract hit level data from Google Analytics?

Step 1: Setup your Google Analytics Account. Step 2: Setup your My SQL Database. Step 3: Create a data flow to Export Hit Level Google Analytics data to MySQL. Your Google Analytics hit level data for each day will be exported to MySQL Database after 24 hours.


4 Answers

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";

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

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"
like image 193
Shermozle Avatar answered Oct 31 '22 14:10

Shermozle


No. But why don't you just use your webserver's logs? The value of GA is not in the data they collect, but the aggregation/analysis. That's why it's not called Google Raw Data.

like image 28
Matthias Winkelmann Avatar answered Oct 31 '22 13:10

Matthias Winkelmann


Please have a look on this article which explains a hack to get Google analytics data. http://blogoscoped.com/archive/2008-01-17-n73.html

Also If you can wait for sometime then official Google analytics blog says that they are working on data export api but currently it is in Private Beta. http://analytics.blogspot.com/2008/10/more-enterprise-class-features-added-to.html

like image 2
MRG Avatar answered Oct 31 '22 15:10

MRG


Not exactly the same as raw vs aggregated, but it seems that "unsampled" data is only available to Premium accounts:

"Unsampled Reports are only available in Premium accounts using the latest version of Google Analytics."
http://support.google.com/analytics/bin/answer.py?hl=en&answer=2601061

like image 2
Jordan Brough Avatar answered Oct 31 '22 14:10

Jordan Brough