Using garb (http://github.com/vigetlabs/garb) i need to fetch the same Map Overlay XML, like Google Analytics web interface export provides. How it can be done?
使用garb (http://github.com/vigetlabs/garb),我需要获取相同的地图覆盖XML,就像谷歌Analytics web界面导出提供的那样。怎么做呢?
Garb::Session.login("email@gmail.com", "pwd")
profile = Garb::Profile.all.first
profile.visits
+
+
class Exits
extend Garb::Model
metrics :pageviews, :visitors, :visits
dimensions :request_uri
end
...works fine.
…工作很好。
But i really cannot get what should i do next to get xml with geodata (city + lon/lat).
但是我真的不知道接下来该怎么做才能用geodata (city + lon/lat)获得xml。
Thanks!
谢谢!
1 个解决方案
#1
5
This should get you in the right direction: http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDimensionsMetrics.html#ga:latitude
这应该能让你找到正确的方向:http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDimensionsMetrics.html#ga:纬度
These are dimensions, so you could get the number of pageviews or visits for a combination of lat/lng.
这些都是尺寸,所以您可以获得联合lat/lng的页面浏览量或访问次数。
Rendering on a map is not something handled by Garb, just to be clear. Garb is only useful for exporting data from the API.
在地图上渲染不是Garb处理的事情,只是为了清楚。Garb只用于从API导出数据。
If you're using Garb with Rails and you're extending an active record object you should be able to call to_xml on that object. To use garb with AR, simply extend the class and set the instance class you want to use with Garb. https://github.com/vigetlabs/garb/wiki/With-an-ORM
如果您正在使用带Rails的Garb,并且正在扩展一个活动记录对象,那么您应该能够在该对象上调用to_xml。要使用带AR的garb,只需扩展类并设置要与garb一起使用的实例类。https://github.com/vigetlabs/garb/wiki/With-an-ORM
#1
5
This should get you in the right direction: http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDimensionsMetrics.html#ga:latitude
这应该能让你找到正确的方向:http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDimensionsMetrics.html#ga:纬度
These are dimensions, so you could get the number of pageviews or visits for a combination of lat/lng.
这些都是尺寸,所以您可以获得联合lat/lng的页面浏览量或访问次数。
Rendering on a map is not something handled by Garb, just to be clear. Garb is only useful for exporting data from the API.
在地图上渲染不是Garb处理的事情,只是为了清楚。Garb只用于从API导出数据。
If you're using Garb with Rails and you're extending an active record object you should be able to call to_xml on that object. To use garb with AR, simply extend the class and set the instance class you want to use with Garb. https://github.com/vigetlabs/garb/wiki/With-an-ORM
如果您正在使用带Rails的Garb,并且正在扩展一个活动记录对象,那么您应该能够在该对象上调用to_xml。要使用带AR的garb,只需扩展类并设置要与garb一起使用的实例类。https://github.com/vigetlabs/garb/wiki/With-an-ORM