Google Analytics Data V1alpha Client - Class ReportDefinition (0.18.0)

Reference documentation and code samples for the Google Analytics Data V1alpha Client class ReportDefinition.

The definition of how a report should be run.

Generated from protobuf message google.analytics.data.v1alpha.ReportTask.ReportDefinition

Namespace

Google \ Analytics \ Data \ V1alpha \ ReportTask

Methods

__construct

Constructor.

Parameters
NameDescription
dataarray

Optional. Data for populating the Message object.

↳ dimensionsarray<Google\Analytics\Data\V1alpha\Dimension>

Optional. The dimensions requested and displayed.

↳ metricsarray<Google\Analytics\Data\V1alpha\Metric>

Optional. The metrics requested and displayed.

↳ date_rangesarray<Google\Analytics\Data\V1alpha\DateRange>

Optional. Date ranges of data to read. If multiple date ranges are requested, each response row will contain a zero based date range index. If two date ranges overlap, the event data for the overlapping days is included in the response rows for both date ranges. In a cohort request, this dateRanges must be unspecified.

↳ dimension_filterGoogle\Analytics\Data\V1alpha\FilterExpression

Optional. Dimension filters let you ask for only specific dimension values in the report. To learn more, see Fundamentals of Dimension Filters for examples. Metrics cannot be used in this filter.

↳ metric_filterGoogle\Analytics\Data\V1alpha\FilterExpression

Optional. The filter clause of metrics. Applied after aggregating the report's rows, similar to SQL having-clause. Dimensions cannot be used in this filter.

↳ offsetint|string

Optional. The row count of the start row from Google Analytics Storage. The first row is counted as row 0. When creating a report task, the offset and limit parameters define the subset of data rows from Google Analytics storage to be included in the generated report. For example, if there are a total of 300,000 rows in Google Analytics storage, the initial report task may have the first 10,000 rows with a limit of 10,000 and an offset of 0. Subsequently, another report task could cover the next 10,000 rows with a limit of 10,000 and an offset of 10,000.

↳ limitint|string

Optional. The number of rows to return in the Report. If unspecified, 10,000 rows are returned. The API returns a maximum of 250,000 rows per request, no matter how many you ask for. limit must be positive. The API can also return fewer rows than the requested limit, if there aren't as many dimension values as the limit. For instance, there are fewer than 300 possible values for the dimension country, so when reporting on only country, you can't get more than 300 rows, even if you set limit to a higher value.

↳ metric_aggregationsarray

Optional. Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to "RESERVED_(MetricAggregation)".

↳ order_bysarray<Google\Analytics\Data\V1alpha\OrderBy>

Optional. Specifies how rows are ordered in the response.

↳ currency_codestring

Optional. A currency code in ISO4217 format, such as "AED", "USD", "JPY". If the field is empty, the report uses the property's default currency.

↳ cohort_specGoogle\Analytics\Data\V1alpha\CohortSpec

Optional. Cohort group associated with this request. If there is a cohort group in the request the 'cohort' dimension must be present.

↳ keep_empty_rowsbool

Optional. If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter. Regardless of this keep_empty_rows setting, only data recorded by the Google Analytics (GA4) property can be displayed in a report. For example if a property never logs a purchase event, then a query for the eventName dimension and eventCount metric will not have a row containing eventName: "purchase" and eventCount: 0.

getDimensions

Optional. The dimensions requested and displayed.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setDimensions

Optional. The dimensions requested and displayed.

Parameter
NameDescription
vararray<Google\Analytics\Data\V1alpha\Dimension>
Returns
TypeDescription
$this

getMetrics

Optional. The metrics requested and displayed.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setMetrics

Optional. The metrics requested and displayed.

Parameter
NameDescription
vararray<Google\Analytics\Data\V1alpha\Metric>
Returns
TypeDescription
$this

getDateRanges

Optional. Date ranges of data to read. If multiple date ranges are requested, each response row will contain a zero based date range index.

If two date ranges overlap, the event data for the overlapping days is included in the response rows for both date ranges. In a cohort request, this dateRanges must be unspecified.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setDateRanges

Optional. Date ranges of data to read. If multiple date ranges are requested, each response row will contain a zero based date range index.

If two date ranges overlap, the event data for the overlapping days is included in the response rows for both date ranges. In a cohort request, this dateRanges must be unspecified.

Parameter
NameDescription
vararray<Google\Analytics\Data\V1alpha\DateRange>
Returns
TypeDescription
$this

getDimensionFilter

Optional. Dimension filters let you ask for only specific dimension values in the report. To learn more, see Fundamentals of Dimension Filters for examples. Metrics cannot be used in this filter.

Returns
TypeDescription
Google\Analytics\Data\V1alpha\FilterExpression|null

hasDimensionFilter

clearDimensionFilter

setDimensionFilter

Optional. Dimension filters let you ask for only specific dimension values in the report. To learn more, see Fundamentals of Dimension Filters for examples. Metrics cannot be used in this filter.

Parameter
NameDescription
varGoogle\Analytics\Data\V1alpha\FilterExpression
Returns
TypeDescription
$this

getMetricFilter

Optional. The filter clause of metrics. Applied after aggregating the report's rows, similar to SQL having-clause. Dimensions cannot be used in this filter.

Returns
TypeDescription
Google\Analytics\Data\V1alpha\FilterExpression|null

hasMetricFilter

clearMetricFilter

setMetricFilter

Optional. The filter clause of metrics. Applied after aggregating the report's rows, similar to SQL having-clause. Dimensions cannot be used in this filter.

Parameter
NameDescription
varGoogle\Analytics\Data\V1alpha\FilterExpression
Returns
TypeDescription
$this

getOffset

Optional. The row count of the start row from Google Analytics Storage.

The first row is counted as row 0. When creating a report task, the offset and limit parameters define the subset of data rows from Google Analytics storage to be included in the generated report. For example, if there are a total of 300,000 rows in Google Analytics storage, the initial report task may have the first 10,000 rows with a limit of 10,000 and an offset of 0. Subsequently, another report task could cover the next 10,000 rows with a limit of 10,000 and an offset of 10,000.

Returns
TypeDescription
int|string

setOffset

Optional. The row count of the start row from Google Analytics Storage.

The first row is counted as row 0. When creating a report task, the offset and limit parameters define the subset of data rows from Google Analytics storage to be included in the generated report. For example, if there are a total of 300,000 rows in Google Analytics storage, the initial report task may have the first 10,000 rows with a limit of 10,000 and an offset of 0. Subsequently, another report task could cover the next 10,000 rows with a limit of 10,000 and an offset of 10,000.

Parameter
NameDescription
varint|string
Returns
TypeDescription
$this

getLimit

Optional. The number of rows to return in the Report. If unspecified, 10,000 rows are returned. The API returns a maximum of 250,000 rows per request, no matter how many you ask for. limit must be positive.

The API can also return fewer rows than the requested limit, if there aren't as many dimension values as the limit. For instance, there are fewer than 300 possible values for the dimension country, so when reporting on only country, you can't get more than 300 rows, even if you set limit to a higher value.

Returns
TypeDescription
int|string

setLimit

Optional. The number of rows to return in the Report. If unspecified, 10,000 rows are returned. The API returns a maximum of 250,000 rows per request, no matter how many you ask for. limit must be positive.

The API can also return fewer rows than the requested limit, if there aren't as many dimension values as the limit. For instance, there are fewer than 300 possible values for the dimension country, so when reporting on only country, you can't get more than 300 rows, even if you set limit to a higher value.

Parameter
NameDescription
varint|string
Returns
TypeDescription
$this

getMetricAggregations

Optional. Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to "RESERVED_(MetricAggregation)".

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setMetricAggregations

Optional. Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to "RESERVED_(MetricAggregation)".

Parameter
NameDescription
varint[]
Returns
TypeDescription
$this

getOrderBys

Optional. Specifies how rows are ordered in the response.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setOrderBys

Optional. Specifies how rows are ordered in the response.

Parameter
NameDescription
vararray<Google\Analytics\Data\V1alpha\OrderBy>
Returns
TypeDescription
$this

getCurrencyCode

Optional. A currency code in ISO4217 format, such as "AED", "USD", "JPY".

If the field is empty, the report uses the property's default currency.

Returns
TypeDescription
string

setCurrencyCode

Optional. A currency code in ISO4217 format, such as "AED", "USD", "JPY".

If the field is empty, the report uses the property's default currency.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getCohortSpec

Optional. Cohort group associated with this request. If there is a cohort group in the request the 'cohort' dimension must be present.

Returns
TypeDescription
Google\Analytics\Data\V1alpha\CohortSpec|null

hasCohortSpec

clearCohortSpec

setCohortSpec

Optional. Cohort group associated with this request. If there is a cohort group in the request the 'cohort' dimension must be present.

Parameter
NameDescription
varGoogle\Analytics\Data\V1alpha\CohortSpec
Returns
TypeDescription
$this

getKeepEmptyRows

Optional. If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter.

Regardless of this keep_empty_rows setting, only data recorded by the Google Analytics (GA4) property can be displayed in a report. For example if a property never logs a purchase event, then a query for the eventName dimension and eventCount metric will not have a row containing eventName: "purchase" and eventCount: 0.

Returns
TypeDescription
bool

setKeepEmptyRows

Optional. If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter.

Regardless of this keep_empty_rows setting, only data recorded by the Google Analytics (GA4) property can be displayed in a report. For example if a property never logs a purchase event, then a query for the eventName dimension and eventCount metric will not have a row containing eventName: "purchase" and eventCount: 0.

Parameter
NameDescription
varbool
Returns
TypeDescription
$this