Here's a quick demo I wrote to test out the Google Analytics API.

It shows pageviews for an Atlassian Confluence wiki on a space by space basis.

You'll need your own copy of Confluence hooked up to Google Analytics for the demo to work, so I've done a video demo too - no sound, sorry.

Confluence & Google Analytics Javascript API from David Simpson on Vimeo.

The main problem for listing data on a space by space basis with the Google Analytics API is that there isn't an equivalent to the Content Drilldown report. My workaround was to get the 500 most popular pages, then using regular expressions, get the spacekeys, remove duplicates and sort alphabetically. Not particularly elegant, but hey.

Next Steps

It's a nice proof of concept, but I'd like to display this information - without the authentication and authorisation step - to users without access to Google Analytics.
e.g. To the owners/administrators of Confluence spaces.

The next step will be to rewrite in Java and embed the data and some charts directly into Confluence with a custom written macro.