Rails 3 / Google Analytics API / Garb

Using garb (http://github.com/vigetlabs/garb), I need to get the same XML Overlay XML as exporting the Google Analytics web interface. How can I do that?

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

But I really can’t get what I have to do to get the xml with geodata (city + lon / lat).

Thank!

+3
source share
1 answer

This should lead you in the right direction: http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDimensionsMetrics.html#ga:latitude

These are sizes, so you can get the number of page views or visits for lat / lng combination.

- , . Garb API.

Garb with Rails , to_xml . garb with AR, , Garb. https://github.com/vigetlabs/garb/wiki/With-an-ORM

+5

Source: https://habr.com/ru/post/1790780/


All Articles