Permalink
Browse files

convert dynamic segment to sessions::conditional

  • Loading branch information...
tpitale committed Apr 19, 2014
1 parent 8222b32 commit f90608a3b3181d6bc90bf24af6e5f544da7e8f0a
Showing with 8 additions and 6 deletions.
  1. +4 −2 README.md
  2. 0 bin/legato
  3. +1 −1 lib/legato/query.rb
  4. +3 −3 spec/lib/legato/query_spec.rb
View
@@ -185,9 +185,9 @@ Operators on dimensions:
substring => '=@',
not_substring => '!@'
## Dynamic Segment
## Session-level Segments
Your query can have a dynamic segment, which works with filter expressions. It
Your query can have a session-level segment, which works with filter expressions. It
works like an [advanced
segment](https://support.google.com/analytics/answer/1033017?hl=en), except you
don't have to create it beforehand, you can just specify it at query time.
@@ -201,6 +201,8 @@ Some metrics and dimensions are not allowed for segments, see the [API
documentation](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#segment)
for more details.
**Note**: Legato does _not_ support [Users vs Sessions](https://developers.google.com/analytics/devguides/reporting/core/v3/segments#users-vs-sessions), yet. The default will be sessions (the equivalent of the earlier, now removed, dynamic segments).
### Defining, using and chaining filters
Return entries with exits counts greater than or equal to 2000
View
0 bin/legato 100644 → 100755
No changes.
View
@@ -187,7 +187,7 @@ def sort=(arr)
end
def segment
"dynamic::#{segment_filters.to_params}" if segment_filters.any?
"sessions::condition::#{segment_filters.to_params}" if segment_filters.any?
end
# def segment_id
@@ -384,11 +384,11 @@ def self.it_defines_operators(*operators)
@query.to_params['filters'].should == 'filter set parameters'
end
it 'includes the dynamic segment' do
segment_filters = stub(:to_params => 'segment parameter', :any? => true)
it 'includes the session level conditional segment' do
segment_filters = stub(:to_params => 'ga::parameter', :any? => true)
@query.stubs(:segment_filters).returns(segment_filters)
@query.to_params['segment'].should == 'dynamic::segment parameter'
@query.to_params['segment'].should == 'sessions::condition::ga::parameter'
end
it 'includes metrics' do

0 comments on commit f90608a

Please sign in to comment.