Skip to content

Using multiple filters doesn't work as expected #119

@lpdahito

Description

@lpdahito

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions