Class CohortSpec.Builder (0.63.0)

public static final class CohortSpec.Builder extends GeneratedMessageV3.Builder<CohortSpec.Builder> implements CohortSpecOrBuilder

The specification of cohorts for a cohort report.

Cohort reports create a time series of user retention for the cohort. For example, you could select the cohort of users that were acquired in the first week of September and follow that cohort for the next six weeks. Selecting the users acquired in the first week of September cohort is specified in the cohort object. Following that cohort for the next six weeks is specified in the cohortsRange object.

For examples, see Cohort Report Examples.

The report response could show a weekly time series where say your app has retained 60% of this cohort after three weeks and 25% of this cohort after six weeks. These two percentages can be calculated by the metric cohortActiveUsers/cohortTotalUsers and will be separate rows in the report.

Protobuf type google.analytics.data.v1beta.CohortSpec

Implements

CohortSpecOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllCohorts(Iterable<? extends Cohort> values)

public CohortSpec.Builder addAllCohorts(Iterable<? extends Cohort> values)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
Name Description
values Iterable<? extends com.google.analytics.data.v1beta.Cohort>
Returns
Type Description
CohortSpec.Builder

addCohorts(Cohort value)

public CohortSpec.Builder addCohorts(Cohort value)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
Name Description
value Cohort
Returns
Type Description
CohortSpec.Builder

addCohorts(Cohort.Builder builderForValue)

public CohortSpec.Builder addCohorts(Cohort.Builder builderForValue)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
Name Description
builderForValue Cohort.Builder
Returns
Type Description
CohortSpec.Builder

addCohorts(int index, Cohort value)

public CohortSpec.Builder addCohorts(int index, Cohort value)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameters
Name Description
index int
value Cohort
Returns
Type Description
CohortSpec.Builder

addCohorts(int index, Cohort.Builder builderForValue)

public CohortSpec.Builder addCohorts(int index, Cohort.Builder builderForValue)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameters
Name Description
index int
builderForValue Cohort.Builder
Returns
Type Description
CohortSpec.Builder

addCohortsBuilder()

public Cohort.Builder addCohortsBuilder()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
Type Description
Cohort.Builder

addCohortsBuilder(int index)

public Cohort.Builder addCohortsBuilder(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
Name Description
index int
Returns
Type Description
Cohort.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CohortSpec.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CohortSpec.Builder
Overrides

build()

public CohortSpec build()
Returns
Type Description
CohortSpec

buildPartial()

public CohortSpec buildPartial()
Returns
Type Description
CohortSpec

clear()

public CohortSpec.Builder clear()
Returns
Type Description
CohortSpec.Builder
Overrides

clearCohortReportSettings()

public CohortSpec.Builder clearCohortReportSettings()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
Type Description
CohortSpec.Builder

clearCohorts()

public CohortSpec.Builder clearCohorts()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
Type Description
CohortSpec.Builder

clearCohortsRange()

public CohortSpec.Builder clearCohortsRange()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
Type Description
CohortSpec.Builder

clearField(Descriptors.FieldDescriptor field)

public CohortSpec.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
CohortSpec.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public CohortSpec.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
CohortSpec.Builder
Overrides

clone()

public CohortSpec.Builder clone()
Returns
Type Description
CohortSpec.Builder
Overrides

getCohortReportSettings()

public CohortReportSettings getCohortReportSettings()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
Type Description
CohortReportSettings

The cohortReportSettings.

getCohortReportSettingsBuilder()

public CohortReportSettings.Builder getCohortReportSettingsBuilder()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
Type Description
CohortReportSettings.Builder

getCohortReportSettingsOrBuilder()

public CohortReportSettingsOrBuilder getCohortReportSettingsOrBuilder()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
Type Description
CohortReportSettingsOrBuilder

getCohorts(int index)

public Cohort getCohorts(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
Name Description
index int
Returns
Type Description
Cohort

getCohortsBuilder(int index)

public Cohort.Builder getCohortsBuilder(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
Name Description
index int
Returns
Type Description
Cohort.Builder

getCohortsBuilderList()

public List<Cohort.Builder> getCohortsBuilderList()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
Type Description
List<Builder>

getCohortsCount()

public int getCohortsCount()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
Type Description
int

getCohortsList()

public List<Cohort> getCohortsList()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
Type Description
List<Cohort>

getCohortsOrBuilder(int index)

public CohortOrBuilder getCohortsOrBuilder(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
Name Description
index int
Returns
Type Description
CohortOrBuilder

getCohortsOrBuilderList()

public List<? extends CohortOrBuilder> getCohortsOrBuilderList()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
Type Description
List<? extends com.google.analytics.data.v1beta.CohortOrBuilder>

getCohortsRange()

public CohortsRange getCohortsRange()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
Type Description
CohortsRange

The cohortsRange.

getCohortsRangeBuilder()

public CohortsRange.Builder getCohortsRangeBuilder()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
Type Description
CohortsRange.Builder

getCohortsRangeOrBuilder()

public CohortsRangeOrBuilder getCohortsRangeOrBuilder()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
Type Description
CohortsRangeOrBuilder

getDefaultInstanceForType()

public CohortSpec getDefaultInstanceForType()
Returns
Type Description
CohortSpec

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

hasCohortReportSettings()

public boolean hasCohortReportSettings()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
Type Description
boolean

Whether the cohortReportSettings field is set.

hasCohortsRange()

public boolean hasCohortsRange()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
Type Description
boolean

Whether the cohortsRange field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeCohortReportSettings(CohortReportSettings value)

public CohortSpec.Builder mergeCohortReportSettings(CohortReportSettings value)

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Parameter
Name Description
value CohortReportSettings
Returns
Type Description
CohortSpec.Builder

mergeCohortsRange(CohortsRange value)

public CohortSpec.Builder mergeCohortsRange(CohortsRange value)

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Parameter
Name Description
value CohortsRange
Returns
Type Description
CohortSpec.Builder

mergeFrom(CohortSpec other)

public CohortSpec.Builder mergeFrom(CohortSpec other)
Parameter
Name Description
other CohortSpec
Returns
Type Description
CohortSpec.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CohortSpec.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CohortSpec.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public CohortSpec.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
CohortSpec.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CohortSpec.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CohortSpec.Builder
Overrides

removeCohorts(int index)

public CohortSpec.Builder removeCohorts(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
Name Description
index int
Returns
Type Description
CohortSpec.Builder

setCohortReportSettings(CohortReportSettings value)

public CohortSpec.Builder setCohortReportSettings(CohortReportSettings value)

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Parameter
Name Description
value CohortReportSettings
Returns
Type Description
CohortSpec.Builder

setCohortReportSettings(CohortReportSettings.Builder builderForValue)

public CohortSpec.Builder setCohortReportSettings(CohortReportSettings.Builder builderForValue)

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Parameter
Name Description
builderForValue CohortReportSettings.Builder
Returns
Type Description
CohortSpec.Builder

setCohorts(int index, Cohort value)

public CohortSpec.Builder setCohorts(int index, Cohort value)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameters
Name Description
index int
value Cohort
Returns
Type Description
CohortSpec.Builder

setCohorts(int index, Cohort.Builder builderForValue)

public CohortSpec.Builder setCohorts(int index, Cohort.Builder builderForValue)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameters
Name Description
index int
builderForValue Cohort.Builder
Returns
Type Description
CohortSpec.Builder

setCohortsRange(CohortsRange value)

public CohortSpec.Builder setCohortsRange(CohortsRange value)

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Parameter
Name Description
value CohortsRange
Returns
Type Description
CohortSpec.Builder

setCohortsRange(CohortsRange.Builder builderForValue)

public CohortSpec.Builder setCohortsRange(CohortsRange.Builder builderForValue)

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Parameter
Name Description
builderForValue CohortsRange.Builder
Returns
Type Description
CohortSpec.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public CohortSpec.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CohortSpec.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public CohortSpec.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
CohortSpec.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final CohortSpec.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CohortSpec.Builder
Overrides