This document describes the Google Analytics
Real Time Reporting API. For a detailed reference of the API, read the
API
Reference
.
Introduction
The Real Time Reporting API enables you to request real time data—for
example, real time activity on your property—for an authenticated
user.
You can use the Real Time Reporting API to:
- Display active viewers of a page and create a sense of
urgency for users 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
Use
Google Analytics superProxy
to handle many of the implementation details of working with Google Analytics
APIs on authentication, caching, and transforming API responses to formats
used directly with visualization and chart libraries.
Conceptual 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)
Before users are able to use your application to request their report data
from a view (profile), you must:
- Enable the Google Analytics API.
- Create
credentials
for your application to access the API.
- Put the credentials into your application.
When using your application to request their report data, users
need to authorize it to access the data on their behalf.
A view (profile) is identified by a View (Profile) ID.
Views (profiles), among other entities, are part of the Google Analytics
hierarchy of accounts, users, properties, and views
.
Your application can use the
Management API
to traverse this hierarchy and obtain a view (profile).
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] available to the API. Also, read the
Real Time Reporting API Reference Guide
to learn 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.
Quota Policy
The Real Time Reporting API handles millions of data query operations. We
employ a quota system to protect the system from receiving more operations
than it can handle, and to ensure an equitable distribution of system
resources. Read the
Limits and Quota
guide for more details.
Next Steps
Now that you understand how the API works, to get started: