0

Context: Many people want to export data from Google Analytics and migrate to another analytics tool, but there isn't a ready-to-use tool yet, see this issue of a well-known open-source project.

It seems that it's not possible to get raw logs from Google Analytics, as stated in this question or here as well.
Of course, one could use his own Apache access.log files, but these files are not always available (for example I haven't stored the logs from 5 years ago, because I knew everything was in Google Analytics, now I see my mistake!).


A partial solution could be: let's export Google Analytics data to Apache-like access.log files. Then this data can be easily imported in any analytics tool.

Question: I have explored the Google Analytics GUI, but I don't find a feature that allows to batch export all past traffic as a log file in the form (include the referrer, user agent, etc.)

mywebsite.com:5.130.131.132 - - [23/Oct/2016:12:08:58 +0200] "GET /bla/abc.php HTTP/1.1" 302 241 "http://www.blabla.com" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"

Is there a feature in Google Analytics that allows to do this?

Community
  • 1
  • 1
Basj
  • 41,386
  • 99
  • 383
  • 673

1 Answers1

0

No, for various reasons:

  • Google Analytics does not expose IP addresses
  • GA records tracking requests to Google servers, not requests to you own server, so GA would not know about the request method for a resource
  • dito for response status (if it has arrived at GA its 200 by default, else the hit would not have been recorded) and content length
  • I do not think GA exposes the full User Agent String

You would either have to add this information via custom dimensions and/or override the sendHitTask to send a copy of the (unprocessed) data to a tracking server of your own. In that case you'd have to implement GA on all of your error pages (for 40x and 50x error statuses) and of course it would only work for future data, it would still not help with data already collected.

The Premium version of GA (recently renamed Google Analytics 360) allows (via BigQuery) for more data fields to be exported, but that would set you back 150 000 USD per year, so it's probably not an option.

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
  • 1
    I don't really care about the request method (GET, etc.), and I don't care about IP of the visitor as well. I would be happy to get only the visit, page visited, datetime of the visit (+ maybe user agent, not mandatory), i.e. all I need to recreate [this chart](https://www.cloudflare.com/img/apps/google-analytics/google-analytics-example.png) with another tool. Would this limited export be possible @EikePierstorff ? – Basj Oct 23 '16 at 16:48
  • Not quite. GA resolves time only down to the minute, and you only get aggregated pageviews per Url, not the individual hits. – Eike Pierstorff Oct 23 '16 at 18:35