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

不问归期 提交于 2019-12-20 10:44:22

问题


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!


回答1:


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




回答2:


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.




回答3:


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




回答4:


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




回答5:


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.



来源:https://stackoverflow.com/questions/4480738/how-to-embed-or-recreate-a-google-analytics-graph-in-a-custom-cms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!