Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to embed or recreate a Google Analytics Graph in a custom CMS

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!

like image 391
Allen Gingrich Avatar asked Dec 18 '10 23:12

Allen Gingrich


People also ask

How do I embed a Google Analytics dashboard into my website?

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.


4 Answers

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

like image 123
Carles Barrobés Avatar answered Sep 28 '22 06:09

Carles Barrobés


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.

like image 41
M Schenkel Avatar answered Sep 28 '22 06:09

M Schenkel


Google now has an article specifically on this topic. https://developers.google.com/analytics/resources/articles/gdataAnalyticsCharts

like image 40
Collin James Avatar answered Sep 28 '22 07:09

Collin James


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

like image 27
Nick Avatar answered Sep 28 '22 08:09

Nick