Is Access To The Google Analytics Realtime Reporting API (via Javascript) Handled Similarly To The Core Reporting API Or Is It Dramatically Different?

- 1 answer

I'm using the 'Hello Analytics' code example found at [][1] to allow me to gain access to my Google Analytics account and log the JSON response to the console. I can traverse the JSON and see how to request specific data I want from the Core Reporting API... Its pretty awesome.

I'm more interested in the realtime data, however. For this particular project I need something faster than the core reporting API...

Questions: Is the Realtime Reporting API something that is accessible via javascript and if so, would it (generally speaking) also work in this same fashion? Meaning Is it just a matter of changing EITHER of the following to get the same type of response from the REALTIME api?

// Set authorized scope.
var SCOPES = [''];


// Load the Google Analytics client library.
gapi.client.load('analytics', 'v3').then(function() {

I see a good number of resources / examples for the core reporting API, but not much on the realtime API



The Core Reporting API and the Real time API work very much the same way, with the same authentication scopes even.

Core Reporting API call

Core Reporting API method reference.

Real time API call

Realtime API method reference.

The Realtime API has is its own set of dimensions and metrics that begin with rt:... where the Core reporting API dimensions and metrics begin with ga:....