tpitale/legato

Dynamic segment query format depreciated as of March 27, 2014

Closed this issue · 4 comments

Google Analytics has depreciated the "dynamic::" format for dynamic segments. It is highly recommended that users switch to the new format as soon as possible.

Whereas a dynamic segment query used to have the format:

segment=dynamic::ga:browser==Chrome

the same query should use the format:

segment=sessions::condition::ga:browser==Chrome

The depreciation is effective as of March 27, 2014

Additional Information:
https://developers.google.com/analytics/devguides/reporting/core/v3/changelog
https://developers.google.com//analytics/devguides/reporting/core/v3/segments#legacy-migration

The depreciation also applys to Google Analytics v2 core reporting API.
https://developers.google.com/analytics/devguides/reporting/core/v2/changelog

What we want here is to support both user and session level segments, which replace "dynamic" segments.

Docs here: https://developers.google.com/analytics/devguides/reporting/core/v3/segments#users-vs-sessions

Important to note, these segments can be combined, but only using AND.

So, in place of "dynamic" segments, there appear to be a few variations. User vs Session level, and conditional vs sequence.

I'm thinking of something like this going forward:

segment(:segment_name, type: :condition, level: :session) do
  gte()
end

Internally, each of the 4 variations will be stored and grouped using AND when segment is added to the query params.

@peterjkirby can you please try out master, see if your results are the same as you would expect with the dynamic segment? If so, I'll cut a new gem.

@tpitale I'll pull it down later this week (probably around Wednesday) and let you know how it works!

Thanks for patching so quickly!