Analytics Market Chart

Google Analytics API

The Google Analytics API is secure, lightweight and flexible. It lays the foundation for the future of web analysis.

The long-awaited Google Analytics API has been released. Developers around the globe are tinkering with it to make programs and applications that can leverage your Google Analytics data in new and profound ways.

So, just what is the API? How does it work? What features are available? Where do we go from here?

What is the API?

At a high level, the Google Analytics API (Application Programming Interface) is a method for exporting raw data from your Google Analytics accounts.

However, this is bigger than the ability to export data. This means the potential for anybody to grab their own data, manipulate it, reformat it, display it, import it into something else. The possibilities are endless. Any scenario where it would be useful to insert your web analytics data is fair game now.

The API was available for several months in private beta. Select companies started developing with it in time to have applications ready for the API's release. This gave the API team at Google opportunity to gauge what kind of a load the API would put on their resources and to spot areas where it could be improved for real-world applications. One notable change during the beta process was to provide only raw data instead of exporting pre-calculated statistics.


Using the API doesn't expose the user to any additional security or privacy risks. The API transmits data securely via HTTPS. When authenticating a user, it only requires the login information once per session. Then it creates a token to pass back and forth with each request.

No third-party servers are required to request or generate the data. It travels directly from Google's servers to your application.


With the Google Analytics API you only have to request necessary data. Instead of downloading an entire report category, the API allows developers to request only specific metrics and dimensions. It even allows the use of regular expressions when requesting data. This permits filtering of data even before it's been received.

In other words, if you only want to know the number of visits from three specific referring sites, you can download just that data and nothing more.

This is especially significant if you are concerned about using up limited bandwidth for mobile applications or any other scenario where bandwidth is at a premium. It also makes transmission and processing times much faster.

The alternative to this was to use some form of screen-scraping to reformat the data. This meant requesting an entire page from the Google Analytics reports, parsing out only the necessary data and then reformatting it as needed. This required more bandwidth to transmit the data and more processing power locally. This was used widely prior to the API release. It is also against the Google Analytics terms of service.


The API returns data in an XML format. This makes processing the data for virtually any application faster, easier and more flexible.

The API also has its own libraries for different coding languages, allowing developers to work with the data much more easily without needing to create their own set of customized commands.

The Future

The potential for an API like this is really unlimited. Creative people with diverse needs will start to find ways to implement this in ways that nobody predicted.

The API can be used to carry GA reports to a variety of new platforms, like your mobile phone or desktop. The API allows for customization of reports never before available--applying more complex segments and custom reports all on the fly. Now developers can tie web analytics into other programs, like CRMs, order fulfillment software, etc. Expect to see web analytics leveraged for more proactive uses, too, like benchmarking and SMS or email alerts. The possibilities are endless.

One thing is certain, though, you will soon be able to use your website data in ways you never imagined before.