This article described a proof-of-concept. The gadget binding feature is not yet in the release, but we hope to have it there soon. If you think it would be a cool feature, please contact us and tell us to hurry up. The gadget data source has been released! Check out this blog article.
One of our incentives in GAQL was to make the GA API even more mashup friendly. Having used Google's Data Visualization API and Gadgets on other projects, this looked like a perfect target for this interest. Gadgets have a specific HTTP GET request response syntax (see references) and consume a JSON data table. The client-server nature of Gadgets means that theoretically any Gadget (Google's and 3rd party) can be use to present any feed.
The HTML below is pretty much boilerplace gadget embedding code. What is different from the standard Gadget samples is the data source url and query language. A typical Gadget embed sample would have code like:
var query = new google.visualization.Query('http://spreadsheets.google.com?key=123AB...'); query.setQuery('select C, sum(B) group by C');That code would be using a Google Docs spreadsheet as the data source, and using the spreadsheet query language to retrieve a tabular view of part of that sheet.
In my GAQL sample, those two lines instead look like:
var query1 = new google.visualization.Query("http://www.shufflepoint.com/gaql2vis.aspx"); query1.setQuery( "SELECT METRICS ga:pageviews ON COLUMNS " + "DIMENSIONS ga:month ON ROWS " + "FROM [www.activeinterface.com] " + "WHERE TIMEFRAME 2008-01-01:2009-01-01" );