public
Description: A Ruby wrapper for the Google Analytics API
Home | Edit | New

Getting Results

As a One-Off Report

One-off reports must have options passed to the initializer at this time:

report = Garb::Report.new(profile,
               :limit => 10,
               :offset => 20,
               :start_date => (Date.today - 30),
               :end_date => Date.today)
report.metrics :exits
report.results

With a Predefined Report

Exits.results(profile, :limit => 10,
                       :offset => 20,
                       :start_date => (Date.today - 30),
                       :end_date => Date.today)

and Filters and Sorting

Exits.results(profile) do
  filter :request_uri.contains => 'fun', :exits.gte => 1000
  sort :exit_rate
end
Last edited by tpitale, Wed Jun 03 23:38:59 -0700 2009
Home | Edit | New
Versions: