Reputation: 125
I'm exploring the applicability of Google Analytics to a certain programming problem, and I have several highly specific questions, for which I can't find answers in the GA help pages.
1) When a GA tracker object sends a data transmission to the GA servers, does the data that gets stored include the date/time of transmission?
2) If the answer to #1 is 'yes,' then can this date/time stamp be included in a GA report?
3) Is it possible to get a report from GA that contains the raw data from a certain tracker, one line per tracker transmission, exactly as the GA servers received it?
Thanks in advance for any replies I get.
Upvotes: 1
Views: 379
Reputation: 32760
The time not send along with the data, it's the time at which the request is received minus the value of the queue time parameter (if set via the measurement protocol).
Time down to the next minute is available in the report or via the API (as ga:dateHour and ga:minute).
You can sent a copy of the raw data to yourself by reconfiguring the sendHitTask. Look at the example from the docs
ga(function(tracker) {
// Grab a reference to the default sendHitTask function.
var originalSendHitTask = tracker.get('sendHitTask');
// Modifies sendHitTask to send a copy of the request to a local server after
// sending the normal request to www.google-analytics.com/collect.
tracker.set('sendHitTask', function(model) {
originalSendHitTask(model);
var xhr = new XMLHttpRequest();
xhr.open('POST', '/localhits', true);
xhr.send(model.get('hitPayload'));
});
});
For storage you need to put a script on your server that can be reached by calling /localhits (in this example, of course you can rename it) and that saves the data (to a text file or a database). You need to write this yourself (and also a script that creates reports from the raw data).
Upvotes: 2