This document provides a high level overview of the Google Analytics Real Time Reporting API. For a detailed reference of the API, read the API Reference.
The Real Time Reporting API enables you to request real time data for an authenticated user. This allows you to report on the activity occurring on your property right now. You can use the Real Time Reporting API to query for dimensions and metrics in order to build customer facing web widgets and dashboards.
You can use the Real Time Reporting API to:
- Display active viewers of a page and create a sense of urgency for users that are looking at an item with finite inventory.
- Display the most popular content such as the top 10 active pages.
- Create and display a real time dashboard.
Google Analytics superProxy
The Google Analytics superProxy can be used to handle many of the implementation details for working with Google Analytics APIs such as authentication, caching, and transforming API responses to formats that can be used directly with visualization and chart libraries. For details read the Google Analytics superProxy overview.
The fundamental concepts underlying the Real Time Reporting API are:
- How reports relate to users and views (profiles).
- The structure of a report and how to build queries.
- Working with the API response.
Reports, Users, and Views (Profiles)
To request report data for a user, your application must identify the user and specify a view (profile) for which to retrieve the data. A user is identified by obtaining authorization credentials and passing them in each API request. A view (profile) is identified by a View (Profile) ID. Views (Profiles), among other entities, are part of the Google Analytics configuration hierarchy. Your application can use the Management API to traverse this hierarchy and obtain a view (profile) ID.
Querying for Dimensions and Metrics
You query the API for Google Analytics report data, which consists of dimensions and metrics. Metrics are the individual measurements of user activity like the number of active users on the property right now. Dimensions break down metrics across some common criteria such as traffic sources, geo location, page information, etc.
Use the Dimensions & Metrics Reference Guide to explore all the dimensions and metrics exposed through the API. Also, read the Real Time Reporting API Reference Guide to learn about how to specify dimensions and metrics in an API query.
Working with Reports
The data returned from the API can be thought of as a table with a header and a list of rows. Each API response consists of a header that describes the name and data type of each column. The response also contains a list of rows, where each row is a list of cells with data in the same order as the headers. Read the Real Time Reporting API Reference Guide for more information about the API response.
The Real Time Reporting API data query handles millions of operations. To protect the system from receiving more operations than it can handle, and to ensure an equitable distribution of system resources, it is necessary to employ a quota system. Read the Limits and Quota guide for more details.
Now that you understand how the API works, we have a bunch of resources to help you get started:
- Read the Developer Guide to learn how to work with the API.
- Check the Dimensions & Metrics Reference Guide for a list of all the data available through the API.
- Check the Libraries & Samples page for a list of all the available client libraries that can be used with this API.