最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to embed or recreate a Google Analytics Graph in a custom CMS - Stack Overflow

programmeradmin4浏览0评论

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 sucks.

Also any reference to how to create a line graph (canvas element?) would be great too.

Thanks!

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!

Share Improve this question edited Dec 19, 2010 at 0:09 Yahel 37.3k23 gold badges106 silver badges154 bronze badges asked Dec 18, 2010 at 23:27 Allen GingrichAllen Gingrich 5,65711 gold badges46 silver badges57 bronze badges 1
  • i was unable to follow Google's Javascript API reference, as well. I found the tutorial at NetTuts+ to be excellent: net.tutsplus.com/tutorials/other/… – doug Commented Dec 19, 2010 at 5:26
Add a comment  | 

5 Answers 5

Reset to default 8

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

Here is step-by-step guide how to embed Google Analytics chart into a webpage as interactive widget: http://explainum.blogspot.com/2011/04/how-to-add-google-analytics-chart-to.html

EDIT (5/15/2012): The link above goes to a blog post on Explainum -- 3rd party web-service which allows creating embeddable charts from various data sources including (and most popular) Google Analytics.

Connection to GA is made using OAuth. You will need to know your GA profile ID in order to connect. Data is updated every 2-24 hours. The service is free.

DISCLAIMER: I'm one of Explainum's creators.

发布评论

评论列表(0)

  1. 暂无评论