Class: Google::Apis::AnalyticsdataV1beta::Cohort

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/analyticsdata_v1beta/classes.rb,
lib/google/apis/analyticsdata_v1beta/representations.rb,
lib/google/apis/analyticsdata_v1beta/representations.rb

Overview

Defines a cohort selection criteria. A cohort is a group of users who share a common characteristic. For example, users with the same firstSessionDate belong to the same cohort.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Cohort

Returns a new instance of Cohort.



291
292
293
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 291

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#date_rangeGoogle::Apis::AnalyticsdataV1beta::DateRange

A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges. Corresponds to the JSON property dateRange



276
277
278
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 276

def date_range
  @date_range
end

#dimensionString

Dimension used by the cohort. Required and only supports firstSessionDate. Corresponds to the JSON property dimension

Returns:

  • (String)


281
282
283
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 281

def dimension
  @dimension
end

#nameString

Assigns a name to this cohort. The dimension cohort is valued to this name in a report response. If set, cannot begin with cohort_ or RESERVED_. If not set, cohorts are named by their zero based index cohort_0, cohort_1, etc. Corresponds to the JSON property name

Returns:

  • (String)


289
290
291
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 289

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



296
297
298
299
300
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 296

def update!(**args)
  @date_range = args[:date_range] if args.key?(:date_range)
  @dimension = args[:dimension] if args.key?(:dimension)
  @name = args[:name] if args.key?(:name)
end