I would like to know how to create a graph with Google Analytics (maybe using the api), but I'm unsure if there is already a plugin or tutorial on how to do this. The Javascript API reference at Google.com sucks.
Also any reference to how to create a line graph (canvas element?) would be great too.
Thanks!
The Google Analytics Embed API is a JavaScript library that allows you to easily create and embed a dashboard on a 3rd party website in a matter of minutes. It gives you a set of pluggable components that can work together to build complex tools, making it both simple and powerful at the same time.
I learned to use the Google Visualization API (the one used by analytics, and the one I believe you refer to) from the examples at https://developers.google.com/chart/interactive/docs and found it quite clear.
You can use examples of different graphs from the Gallery as well: http://code.google.com/apis/visualization/documentation/gallery.html
I created a service specifically for this purpose: EmbeddedAnalytics
You define your chart type (line, bar, horizontal bar), metrics (pageviews, visits, etc), dimension (date, country,etc), and a time frame. Then you simply embed a snippet of code into your site where you want the chart to appear.
Google now has an article specifically on this topic. https://developers.google.com/analytics/resources/articles/gdataAnalyticsCharts
Try this:
Google Analytics Easy Dashboard Javascript Library
An easy way to build a custom Google Analytics Dashboard on your own page.
http://analytics-api-samples.googlecode.com/svn/trunk/src/reporting/javascript/ez-ga-dash/docs/user-documentation.html#register
Demo: http://analytics-api-samples.googlecode.com/svn/trunk/src/reporting/javascript/ez-ga-dash/demos/set-demo.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With