Class CohortSpec (0.52.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
TypeDescription
int

COHORTS_RANGE_FIELD_NUMBER

public static final int COHORTS_RANGE_FIELD_NUMBER
Field Value
TypeDescription
int

COHORT_REPORT_SETTINGS_FIELD_NUMBER

public static final int COHORT_REPORT_SETTINGS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static CohortSpec getDefaultInstance()
Returns
TypeDescription
CohortSpec

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static CohortSpec.Builder newBuilder()
Returns
TypeDescription
CohortSpec.Builder

newBuilder(CohortSpec prototype)

public static CohortSpec.Builder newBuilder(CohortSpec prototype)
Parameter
NameDescription
prototypeCohortSpec
Returns
TypeDescription
CohortSpec.Builder

parseDelimitedFrom(InputStream input)

public static CohortSpec parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static CohortSpec parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CohortSpec parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CohortSpec parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static CohortSpec parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static CohortSpec parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CohortSpec parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CohortSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<CohortSpec> parser()
Returns
TypeDescription
Parser<CohortSpec>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCohortReportSettings()

public CohortReportSettings getCohortReportSettings()

Optional settings for a cohort report.

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

Returns
TypeDescription
CohortReportSettings

The cohortReportSettings.

getCohortReportSettingsOrBuilder()

public CohortReportSettingsOrBuilder getCohortReportSettingsOrBuilder()

Optional settings for a cohort report.

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

Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
CohortsRangeOrBuilder

getDefaultInstanceForType()

public CohortSpec getDefaultInstanceForType()
Returns
TypeDescription
CohortSpec

getParserForType()

public Parser<CohortSpec> getParserForType()
Returns
TypeDescription
Parser<CohortSpec>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hasCohortReportSettings()

public boolean hasCohortReportSettings()

Optional settings for a cohort report.

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

Returns
TypeDescription
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
TypeDescription
boolean

Whether the cohortsRange field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public CohortSpec.Builder newBuilderForType()
Returns
TypeDescription
CohortSpec.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CohortSpec.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
CohortSpec.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public CohortSpec.Builder toBuilder()
Returns
TypeDescription
CohortSpec.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException