Open lpdahito opened 12 years ago
I have the following code:
require 'garb' Garb::Session.login("username", "password") profile = Garb::Management::Profile.all.detect {|p| p.title == "Admin"} class PageViews extend Garb::Model metrics :pageviews dimensions :page_path end date1 = Date.today - 30 date2 = Date.today object = PageViews.results(profile, :start_date => date1, :end_date => date2, :filters => [{:page_path.matches => "/home"}, {:page_path.matches => "/about"}]) object.each do |result| puts "#{result.page_path} #{result.pageviews}" end
The output expected from this code should be this:
/about 32 /home 106
Instead, the result I get outputs all the "page_paths" of my website with its number of pageviews:
/ 503 /about 32 /contact 12 /home 106 ... etc
What seems to be the problem? How do I fix it?
Thank you,
LP
By the way I'm using: Ruby 1.9.2 garb (0.9.1)
+1
I have the following code:
The output expected from this code should be this:
Instead, the result I get outputs all the "page_paths" of my website with its number of pageviews:
What seems to be the problem? How do I fix it?
Thank you,
LP