-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathCohortSpec.php
More file actions
179 lines (160 loc) · 6.68 KB
/
CohortSpec.php
File metadata and controls
179 lines (160 loc) · 6.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/analytics/data/v1alpha/data.proto
namespace Google\Analytics\Data\V1alpha;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;
/**
* 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](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#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.
*
* Generated from protobuf message <code>google.analytics.data.v1alpha.CohortSpec</code>
*/
class CohortSpec extends \Google\Protobuf\Internal\Message
{
/**
* 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.
*
* Generated from protobuf field <code>repeated .google.analytics.data.v1alpha.Cohort cohorts = 1;</code>
*/
private $cohorts;
/**
* Cohort reports follow cohorts over an extended reporting date range. This
* range specifies an offset duration to follow the cohorts over.
*
* Generated from protobuf field <code>.google.analytics.data.v1alpha.CohortsRange cohorts_range = 2;</code>
*/
protected $cohorts_range = null;
/**
* Optional settings for a cohort report.
*
* Generated from protobuf field <code>.google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;</code>
*/
protected $cohort_report_settings = null;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Google\Analytics\Data\V1alpha\Cohort[] $cohorts
* 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.
* @type \Google\Analytics\Data\V1alpha\CohortsRange $cohorts_range
* Cohort reports follow cohorts over an extended reporting date range. This
* range specifies an offset duration to follow the cohorts over.
* @type \Google\Analytics\Data\V1alpha\CohortReportSettings $cohort_report_settings
* Optional settings for a cohort report.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce();
parent::__construct($data);
}
/**
* 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.
*
* Generated from protobuf field <code>repeated .google.analytics.data.v1alpha.Cohort cohorts = 1;</code>
* @return RepeatedField<\Google\Analytics\Data\V1alpha\Cohort>
*/
public function getCohorts()
{
return $this->cohorts;
}
/**
* 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.
*
* Generated from protobuf field <code>repeated .google.analytics.data.v1alpha.Cohort cohorts = 1;</code>
* @param \Google\Analytics\Data\V1alpha\Cohort[] $var
* @return $this
*/
public function setCohorts($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\Cohort::class);
$this->cohorts = $arr;
return $this;
}
/**
* Cohort reports follow cohorts over an extended reporting date range. This
* range specifies an offset duration to follow the cohorts over.
*
* Generated from protobuf field <code>.google.analytics.data.v1alpha.CohortsRange cohorts_range = 2;</code>
* @return \Google\Analytics\Data\V1alpha\CohortsRange|null
*/
public function getCohortsRange()
{
return $this->cohorts_range;
}
public function hasCohortsRange()
{
return isset($this->cohorts_range);
}
public function clearCohortsRange()
{
unset($this->cohorts_range);
}
/**
* Cohort reports follow cohorts over an extended reporting date range. This
* range specifies an offset duration to follow the cohorts over.
*
* Generated from protobuf field <code>.google.analytics.data.v1alpha.CohortsRange cohorts_range = 2;</code>
* @param \Google\Analytics\Data\V1alpha\CohortsRange $var
* @return $this
*/
public function setCohortsRange($var)
{
GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\CohortsRange::class);
$this->cohorts_range = $var;
return $this;
}
/**
* Optional settings for a cohort report.
*
* Generated from protobuf field <code>.google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;</code>
* @return \Google\Analytics\Data\V1alpha\CohortReportSettings|null
*/
public function getCohortReportSettings()
{
return $this->cohort_report_settings;
}
public function hasCohortReportSettings()
{
return isset($this->cohort_report_settings);
}
public function clearCohortReportSettings()
{
unset($this->cohort_report_settings);
}
/**
* Optional settings for a cohort report.
*
* Generated from protobuf field <code>.google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;</code>
* @param \Google\Analytics\Data\V1alpha\CohortReportSettings $var
* @return $this
*/
public function setCohortReportSettings($var)
{
GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\CohortReportSettings::class);
$this->cohort_report_settings = $var;
return $this;
}
}