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.



390
391
392
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 390

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



375
376
377
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 375

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)


380
381
382
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 380

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)


388
389
390
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 388

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



395
396
397
398
399
# File 'lib/google/apis/analyticsdata_v1beta/classes.rb', line 395

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