Class CohortSpec (0.64.0)

public final class CohortSpec extends GeneratedMessageV3 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 Fields

COHORTS_FIELD_NUMBER

public static final int COHORTS_FIELD_NUMBER
Field Value
Type Description
int

COHORTS_RANGE_FIELD_NUMBER

public static final int COHORTS_RANGE_FIELD_NUMBER
Field Value
Type Description
int

COHORT_REPORT_SETTINGS_FIELD_NUMBER

public static final int COHORT_REPORT_SETTINGS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CohortSpec getDefaultInstance()
Returns
Type Description
CohortSpec

getDescriptor()

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

newBuilder()

public static CohortSpec.Builder newBuilder()
Returns
Type Description
CohortSpec.Builder

newBuilder(CohortSpec prototype)

public static CohortSpec.Builder newBuilder(CohortSpec prototype)
Parameter
Name Description
prototype CohortSpec
Returns
Type Description
CohortSpec.Builder

parseDelimitedFrom(InputStream input)

public static CohortSpec parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CohortSpec
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CohortSpec
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CohortSpec parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CohortSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CohortSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CohortSpec parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CohortSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CohortSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CohortSpec parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CohortSpec
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CohortSpec
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CohortSpec parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CohortSpec
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CohortSpec
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CohortSpec parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CohortSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CohortSpec
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CohortSpec> parser()
Returns
Type Description
Parser<CohortSpec>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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.

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

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.

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

getParserForType()

public Parser<CohortSpec> getParserForType()
Returns
Type Description
Parser<CohortSpec>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CohortSpec.Builder newBuilderForType()
Returns
Type Description
CohortSpec.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CohortSpec.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CohortSpec.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CohortSpec.Builder toBuilder()
Returns
Type Description
CohortSpec.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException