Why doesn’t Google analytics have an API?

I really want an API for Google analytics, I have some specific ideas for combining analytics data with other data available via external APIs but for some reason Google are jittery about people publishing the data collected about their site traffic.

Thankfully a good few people have put their screen-scraping skills to use in order to provide some solutions to this problem. I recently stumbled upon Chris Riley‘s post detailing one method of extracting Analytics data, the basic process is as follows:

  1. Obtain the tracking data in a usable format – We can schedule Google Analytics to email this as an XML file on a regular basis.
  2. Make the XML file accessible online – By emailing an attachment to Google Groups, the file is automatically given a public URL.
  3. Work out the URL of the most recent report – Since Google Groups provides RSS/Atom feeds for all messages, we can easily find the URL of the most recent message and therefore work out the URL of the XML report.
  4. Prepare the data for use – We need to manipulate the XML and massage it into a handy JSON format that we can use on our blog, which can all be done using Yahoo Pipes.
  5. Display the links on your site – With just a bit of client-side JavaScript, you can finally add a self-updating “Most Popular Posts” section to your blog.

See the full details at Google Blogoscoped

I just can’t work out why Google, who are normally excellent in terms of providing open APIs for their services, have yet to allow customers to make better use of their traffic data. Perhaps they are concerned with the privacy issues of exposing data collected concerning the browsing habits of web-users. I’m sure that this could be remedied by limiting the extent to which data can be drilled into through the API. Possibly they don’t feel that it’s not a good use of resources to build an API for a free product which already has a large user base. It may take a competitor who does provide an API to gain some market share before they decide to do something about it.

8 Responses

Leave a Reply