Introduction

Using Google Analytics

The Google Analytics API allows client applications to request data, saved in the analytics accounts.

See » http://code.google.com/apis/analytics/docs/gdata/v2/gdataOverview.html for more information about the Google Analytics API.

Retrieving account data

Using the account feed, you are able to retrieve a list of all the accounts available to a specified user.

  1. span style="color: #ff0000;">"\n{$account->title}\n";
  2. }

The $analytics->getAccountFeed() call, results in a Zend_Gdata_Analytics_AccountFeed object that contains Zend_Gdata_Analytics_AccountEntry objects. Each of this objects represent a google analytics account.

Retrieving report data

Besides the account feed, google offers a data feed, to retrieve report data using the Google Analytics API. To easily request for these reports, Zend_Gdata_Analytics offers a simple query construction interface. You can use all the » metrics and dimensions specified by the API. Additionaly you can apply some » filters to retrieve some » common data or even complex results.

  1. span style="color: #ff0000;">"ga:browser==Firefox"'2011-05-01''2011-05-31''ga:visits')."\t"'ga:bounces')."\n"
  2. }

Introduction