Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby client library for accessing google analytics feeds
tree: e0c8ba1281

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.document
.gitignore
.rspec
Gemfile
LICENSE.txt
README.rdoc
Rakefile
VERSION
google_analytics_feeds.gemspec

README.rdoc

Google Analytics Feeds

Allows access to google analytics feeds from ruby.

Does not support any of the OAuth-related authentication methods.

Installation

gem install google_analytics_feeds

Usage

require 'google_analytics_feeds'

# Define your report. Reports are built up like an ActiveRecord or 
# Sequel::Dataset query.
report = GoogleAnalyticsFeeds::DataFeed.new.
  profile(123456).
  dimensions(:visitor_type).
  metrics(:visits)

# Create a session and login. You can optionally pass a
# Faraday::Connection to +new+ to use a different adapter, deal 
# with proxies etc.
session = GoogleAnalyticsFeeds::Session.new
session.login("username", "password")

# Fetch a report. Rows are handled with a 
# GoogleAnalyticsFeed::RowHandler - this may just be an anonymous
# block as demonstrated here.
session.fetch_report(report) do
  def row(r)
    puts r.inspect # => outputs the row as a hash.
  end
end

TODO

  • Tests, documentation

  • Filters

  • Access to the management data feed.

  • Auto-follow of paginated result sets.

Versioning

Patch-level releases will not change the API. Minor releases may make breaking changes to the API until a 1.0 release.

Contributing to google_analytics_feeds

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.

  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright © 2012 Roland Swingler. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.