Integrate with Visualization API

266 views
Skip to first unread message

Dev

unread,
Jun 12, 2009, 3:50:20 AM6/12/09
to google-analytics-api - GA Data Export API
Hello,

I wanted to integrate my Google Analytics export data with the
Visualization API. Basically, I want to recreate an exact replica of
the Google Analytics Timeline. I can't find any examples to help me.

I have searched for many hours now but have found no easy solution.
Thanks for your help.

POP Analytics

unread,
Jun 12, 2009, 10:28:24 AM6/12/09
to google-analytics-api - GA Data Export API
While this isn't a pure GA API solution, Shufflepoint wrote a very
nice post on how to integrate the Visualization API with their GA
solution.

It includes some great code examples which should help you out:
http://blog.shufflepoint.com/2009/05/creating-gadgets-and-charts-with-shufflepoint-and-the-google-visualization-api.html

- Ophir
http://www.POP.us

Dev

unread,
Jun 12, 2009, 12:39:57 PM6/12/09
to google-analytics-api - GA Data Export API
Thanks for your reply. I looked through the blog post and
unfortunately could not find what I wanted.

I want to recreate the Google Analytics Timeline. I'm studying the
"Annotated Timeline" visualization, but have no idea how to use my
Google Analytics data as the data to populate the timeline.

On Jun 12, 9:28 am, POP Analytics wrote:
> While this isn't a pure GA API solution, Shufflepoint wrote a very
> nice post on how to integrate the Visualization API with their GA
> solution.
>
> It includes some great code examples which should help you out:http://blog.shufflepoint.com/2009/05/creating-gadgets-and-charts-with...
>
> - Ophirhttp://www.POP.us

Dev

unread,
Jun 12, 2009, 12:43:00 PM6/12/09
to google-analytics-api - GA Data Export API
Here is an example of what I want to do, but this is built in grails.
I would like to build in PHP.
http://mrhaki.blogspot.com/2009/03/display-google-visualization-charts-in.html

Nick

unread,
Jun 15, 2009, 1:16:18 PM6/15/09
to google-analytics-api - GA Data Export API
Hi There,

The Google Visualization API has a data table format which all
visualizations are built on top of :
http://code.google.com/apis/visualization/documentation/reference.html
Currently the data format of the GA API data feed is different from
the Google Viz dataTable so your program will need to convert the feed
format to the dataTable.

Using PHP you have 2 options:
1 - You can implement a Google Visualization data source (similar to
the grail example above). This will allow an HTML page with JavaScript
to use the Google Visualization's native query operation to pull data
from your script. There's a PHP library to implement a Google Viz data
source here : http://code.google.com/p/google-visualization-php-api/
The only drawback I see here is if you want to keep your data secure,
you'll need to implement some sort of authentication so only
authorized JavaScripts can access your data source. But the benefit is
that the solution is quite scalable if you want other people to
implement client side apps without touching the PHP.

2 - Your PHP code can go through the GA data feed and directly write a
JSON dataTable object to the page, then in the browser, the
visualization that you want to use can directly reference the JSON
object. Here are the details of the JSON dataTable object :
http://code.google.com/apis/visualization/documentation/reference.html#dataparam
The benefit with this is your data can be sent across HTTPS and not
have to implement another auth routine. Though if you want to modify
your code later, you'll have to also modify the PHP script.

Good Luck!
-Nick



On Jun 12, 9:43 am, Dev wrote:
> Here is an example of what I want to do, but this is built in grails.
> I would like to build in PHP.http://mrhaki.blogspot.com/2009/03/display-google-visualization-chart...
Reply all
Reply to author
Forward
0 new messages