Google Analytics - less than a few minutes ago

Google Analytics Realtime provides rt:minutesAgo on which you can filter requests.

However, this dimension, not the metric, <= cannot be used in the filter.

Assuming I want to get a numerical metric (e.g. rt:totalEvents ) in the last n minutes, what would be the best way to do this?


For now, the only idea I have is to create a regular expression that matches the numbers <= n, use =~ , and then sum all rt:totalEvents in the result set. It sounds wrong at so many levels.

+8
google-analytics google-analytics-api
source share
1 answer

As I understand it, minutesAgo is a measurement of time and cannot be a metric, because it cannot be aggregated in any way by default.

Imagine that you expand the country by country (dimensions = rt: country) ... and there are N visitors from one country that came to your site in the last 10 minutes. What would be the value of minutesAgo? average? last?

Metrics must be aggregate so that they can be metrics. Time values ​​in OLAP databases, as a rule, do not have this property (in essence), therefore they are better modeled as sizes (usually by periods: "day", "week" ... or in this case "minutesAgo").

As @Pete already mentioned, in this case you can apply a long combination of filters (or regular expression) and use totalsForAllResults :

 "totalsForAllResults": { "rt:totalEvents": "2" }, 
+4
source share

All Articles