Skip to content

Instantly share code, notes, and snippets.

@VictorTpo
Last active March 16, 2016 14:35
Show Gist options
  • Save VictorTpo/97b85b80c829a4b65975 to your computer and use it in GitHub Desktop.
Save VictorTpo/97b85b80c829a4b65975 to your computer and use it in GitHub Desktop.
Tracking.all
> id: 1, label: button_1, page: page_1
> id: 2, label: button_1, page: page_1
> id: 3, label: button_2, page: page_2
> id: 4, label: button_1, page: page_2
> id: 5, label: button_1, page: page_2
> id: 6, label: button_2, page: page_1
Tracking.group(:label).count
> {button_1: 4, button_2: 2}
Tracking.group(:label, :page).count
>{
  [button_1, page_1] => 3,
  [button_1, page_2] => 1,
  [button_2, page_1] => 1,
  [button_2, page_2] => 1,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment