2010-06-16 61 views
3

我期待构建Rails应用程序,以对我公司收集的数据执行内部报告(制作图表或一般数据可视化,创建报告,显示统计分析等)。在Rails中构建分析仪表板

什么会有助于建设呢?例如,我应该熟悉的任何Rails/Javascript库,或者我应该看看的任何开源分析应用程序或现有仪表板工具?

回答

1

我现在确实在做同样的事情,所以我知道你正在经历什么。对于轨道上的红宝石,那里有一块叫做Garb的宝石。到目前为止,它对我来说工作得很好。例如:

results = [] 
Garb::Session.login(analytics_email_address, analytics_password) 
web_properties = Garb::Profile.all #you can filter here with a clojure or something 
for profile in web_properties 
    report = Garb::Report.new(profile, start_date, end_date) 
    report.metrics MY_METRICS #you can read about these on the analytics api docs 
    report.dimensions MY_DIMENSIONS #same here 
    results << report.results 
end 
#do more stuff 

这是一个简单/快速/脏的例子,但它的工作原理;你可以得到你所需的指标和维度,这里的信息:

http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDimensionsMetrics.html

和装束的信息在这里:

http://www.viget.com/extend/introducing-garb-access-the-google-analytics-data-export-api-with-ruby/

我知道报告是很无奈,所以我希望你的祝你好运!

1

如果您有大量数据,请不要忘记为您的数据创建摘要。例如,计算一天中的所有综合浏览量并将其存储在Day表格左右。否则,您的应用程序将变得无法响应。不要忘记,Ruby 1.8吸收统计和数学(慢)