Skip to content
jdrap edited this page Jul 20, 2011 · 18 revisions

With a Class and Filters and Sorting

Exits.results(profile, :limit => 10,
                       :offset => 20,
                       :start_date => (Date.today - 30),
                       :end_date => Date.today,
                       :filters => {:pageviews.gte => 200},
                       :sort => :pageviews)

The shorthand with a given profile is also nice:

profile.exits(:limit => 10, :offset => 20)

This can be done with any class which extends Garb::Model

Filtering with :contains and a regular expression

Note that contains accepts a regex notation but as a string rather than a actual regex literal. For example, to get results for all pages with a path containing “blog/posts/any-post-title” use this:

Exits.results(profile, :filters => {:page_path.contains => "^\/blog\/posts\/.+" })

Instead of:

Exits.results(profile, :filters => {:page_path.contains => /^\/blog\/posts\/.+/ })

hola

Clone this wiki locally