Google Analytics API

The Google Analytics API is a datasource for CakePHP. It allows you to extract all statistics available to your account by using web scraping techniques.

Download

You can download the latest version of the API here: Download 1.0

Documentation

A complete documentation of the API will show up here soon. For now please take a look at the blog post about the Google Analytics API over at ThinkingPHP.

Is it safe to use?

The short answer is no. The long answer is, it's safe enough for lots of usage cases.

The API is only possible because Google has made no efforts so far at obfuscating the access. They seem to be aware of people using web scraping techniques for extracting data from their service, but no official statements about their view on this subject has been made in public.

However, not all is bad. This API is a little more robust then most APIs that are based on web scraping. That is because Google makes all data available for manual download via in XML, CSV, TSV and PDF format. The main assumption made by the API is that the urls to those export downloads will not change over time. Nobody can give a guarantee that this won't happen. But since those urls are pretty much tied to the infrastructure of the service, there is a good change they will not change.

We will also try to provide fast updates in case Google would make breaking changes. However, if Google at any point decides to activly obfuscate or disallow automated access, we will not try to overcome those barriers.

License

The Google Analytics API is licensed under the MIT license. This means you can do just about anything with it other than removing the license information. Software projects that are using this code do not need to be open source or even mention the usage of the code published here.

Unless stated otherwise, the entire code was written by Debuggable Limited.