My favorites | English | Sign in

More personalization in Google Friend Connect New!

Google Analytics (Labs)

Data API - Feed Reference

This document provides detailed reference on the structure of the Google Analytics Data Export API feeds. For client-library specific information, see the Developer Guide.

Contents

  1. Feeds Overview
  2. Analytics Users, Accounts, and Web Properties
  3. User Authorization

Feeds Overview

The Analytics Data Export API provides two main feed types: account feeds and data feeds. For all feeds, there are a number of considerations you should keep in mind:

  • The default number of entries returned from a request is 1,000.
  • The maximum number of entries returned from a request is 10,000. For example, you can use the max-results parameter to request up to 10,000 rows. Use the start-index along with the max-results parameter to page through larger blocks of data.
  • Invalid query parameters, such as 0 for start-index will result in an error response from the server.
  • Analytics feed responses contain many of the standard Atom response elements, such as ID, title, and author.

Analytics Users, Accounts, and Web Properties

Google Analytics account management consists of a number of layers that allow for a great deal of flexibility for tracking web properties and allowing user access to your reports. This section briefly summarizes the features and terms used in Analytics account management. For detailed information about Analytics accounts and profiles, see the Accounts and Profiles documentation.

Google Account Analytics uses Google Accounts to authenticate their users, just like many other Google products (e.g. Google Calendar, Gmail). You authenticate to Analytics with your Google Account ID, and then you can use any Analytics account you are authorized to use.
Analytics Account A Google Analytics account is a way for you to administer tracking for a collection of web properties.
  • Authorization to an Analytics account does not require separate user authentication or log-in. Account access is provided by the Analytics Account administrator(s).
  • Users can have access to many Analytics accounts, but they must either be the owner of the account or be authorized to access the account by the owner.
Account ID When you create an account in Google Analytics, any web property that you track in that account will use the same account ID, which is the central portion of the web property ID. For example, if the web property ID for your site is UA-10876-1, then 10876 is the account ID. For Data Export API access, the central number of the string (e.g. 10876) is used to request feed data from a particular web property.
Web Property ID

A web property ID is a string in the form of UA-xxxxx-yy that is part of the Google Analytics tracking code entered in your web property. It links web properties to profiles in Analytics accounts.

Profile Each Analytics account has one or more profiles.
  • A given profile belongs to one Analytics account, and it tracks exactly one web property.
  • Profile access can be limited to specific account users. So, even if users have access to an account, they might not have access to all profiles in the account.
Profile ID

A profile ID is a globally-unique number assigned to a profile in an Analytics account. For example, if account 12345 has 6778 as one if its profiles, then no other account will have that profile. This ID is viewable in the Profile Settings page in the Analytics Administrative interface:

In the Data Export API for Analytics, the profile ID is exposed in the Account Feed as a dxp:property element with the name ga:profileId. See Account Feed Response for more information.

Table ID A table ID is the unique, namespaced profile ID. In the Data Export API, the table ID is exposed in both the Account Feed and Data Feed as dxp:tableId. The table ID is required in the data feed request in order to retrieve data from the correct profile.

User Authorization

The login process for your client application determines two distinct things about the user accessing the feed data:

  • Does the user have a valid Google Account with valid login credentials?
  • Which Google Analytics profiles and accounts does the user have access to?

If Google Account login fails for the user, an error is returned. At this point in the process, the application is concerned only with authorization to Google Accounts in general. The purpose is to determine that the credentials entered by the user are indeed valid for that particular Google Account.

If Google Accounts login succeeds, the server next determines whether the user has access to the requested Google Analytics profile. The profile ID provided in the data feed is uniquely associated with an Analytics account, so the server can determine if the user has access to the Analytics account and to the particular profile associated with that account. Recall that a given user might have access to the particular Google Analytics account that you are querying, but might not have permissions to the particular profile in that account. If authorization for either the account or the profile fails, the server returns an error.

Back to Top