0.15.1 (latest) 0.15.0 0.14.1 0.8.0 0.7.0 0.6.2 0.5.0 0.4.1 0.3.1 0.2.0 0.1.3 Reference documentation and code samples for the Google Ads Ad Manager V1 Client class ReportDefinition.

The definition of how a report should be run.

Generated from protobuf message `google.ads.admanager.v1.ReportDefinition`

## Namespace

Google \\ Ads \\ AdManager \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ dimensions` | `int[]` Required. The list of dimensions to report on. If empty, the report will have no dimensions, and any metrics will be totals. |
| `↳ metrics` | `int[]` Required. The list of metrics to report on. If empty, the report will have no metrics. |
| `↳ filters` | `array<https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.Filter>` Optional. The filters for this report. |
| `↳ time_zone_source` | `int` Optional. Where to get the time zone for this report. Defaults to using the network time zone setting (PUBLISHER). If source is PROVIDED, the time_zone field in the report definition must also set a time zone. |
| `↳ time_zone` | `string` Optional. If time_zone_source is PROVIDED, this is the time zone to use for this report. Leave empty for any other time zone source. Time zone in IANA format. For example, "America/New_York". |
| `↳ currency_code` | `string` Optional. The ISO 4217 currency code for this report. Defaults to publisher currency code if not specified. |
| `↳ date_range` | `https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.DateRange` Required. The primary date range of this report. |
| `↳ comparison_date_range` | `https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.DateRange` Optional. The comparison date range of this report. If unspecified, the report won't have any comparison metrics. |
| `↳ cms_metadata_dimension_key_ids` | `int[]|string[]` Optional. CMS Metadata Dimension keys that represent CMS_METADATA_DIMENSION_\* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, cms_metadata_dimension_key_ids\[0\] describes CMS_METADATA_DIMENSION_0_VALUE_ID and CMS_METADATA_DIMENSION_0_VALUE. |
| `↳ custom_dimension_key_ids` | `int[]|string[]` Optional. Custom Dimension keys that represent CUSTOM_DIMENSION_\* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, custom_dimension_key_ids\[0\] describes CUSTOM_DIMENSION_0_VALUE_ID and CUSTOM_DIMENSION_0_VALUE. |
| `↳ ekv_dimension_key_ids` | `int[]|string[]` Optional. Enhanced Key-values Dimension keys that represent EKV_DIMENSION_\* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, ekv_dimension_key_ids\[0\] describes EKV_DIMENSION_0_VALUE_ID and EKV_DIMENSION_0_VALUE. |
| `↳ line_item_custom_field_ids` | `int[]|string[]` Optional. Custom field IDs that represent LINE_ITEM_CUSTOM_FIELD_\* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, line_item_custom_field_ids\[0\] describes LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID and LINE_ITEM_CUSTOM_FIELD_0_VALUE. |
| `↳ order_custom_field_ids` | `int[]|string[]` Optional. Custom field IDs that represent ORDER_CUSTOM_FIELD_\* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, order_custom_field_ids\[0\] describes ORDER_CUSTOM_FIELD_0_OPTION_ID and ORDER_CUSTOM_FIELD_0_VALUE. |
| `↳ creative_custom_field_ids` | `int[]|string[]` Optional. Custom field IDs that represent CREATIVE_CUSTOM_FIELD_\* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, creative_custom_field_ids\[0\] describes CREATIVE_CUSTOM_FIELD_0_OPTION_ID and CREATIVE_CUSTOM_FIELD_0_VALUE. |
| `↳ report_type` | `int` Required. The type of this report. |
| `↳ time_period_column` | `int` Optional. Include a time period column to introduce comparison columns in the report for each generated period. For example, set to "QUARTERS" here to have a column for each quarter present in the primary date range. If "PREVIOUS PERIOD" is specified in comparison_date_range, then each quarter column will also include comparison values for its relative previous quarter. |
| `↳ flags` | `array<https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.Flag>` Optional. List of flags for this report. Used to flag rows in a result set based on a set of defined filters. |
| `↳ sorts` | `array<https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.Sort>` Optional. Default sorts to apply to this report. |
| `↳ expanded_compatibility` | `bool` Optional. Whether to use expanded compatibility for this report. If true, this setting enables certain combinations of dimensions and metrics for this report that would otherwise be incompatible. Enabling this will collapse reservation data into a single row even if the report's dimensions would normally result in multiple rows for reservation data. This impacts dimensions related to line items, orders, creatives, and advertisers. This is equivalent to the "Access more dimension and metric combinations" setting in the Interactive Reports UI. For more details, see: <https://support.google.com/admanager/answer/16865393#combinations> |

### getDimensions

Required. The list of dimensions to report on. If empty, the report will
have no dimensions, and any metrics will be totals.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<int>` |   |

### setDimensions

Required. The list of dimensions to report on. If empty, the report will
have no dimensions, and any metrics will be totals.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMetrics

Required. The list of metrics to report on. If empty, the report will have
no metrics.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<int>` |   |

### setMetrics

Required. The list of metrics to report on. If empty, the report will have
no metrics.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFilters

Optional. The filters for this report.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.Filter>` |   |

### setFilters

Optional. The filters for this report.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.Filter>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTimeZoneSource

Optional. Where to get the time zone for this report. Defaults to using the
network time zone setting (PUBLISHER). If source is PROVIDED, the time_zone
field in the report definition must also set a time zone.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [TimeZoneSource](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.TimeZoneSource). |

### setTimeZoneSource

Optional. Where to get the time zone for this report. Defaults to using the
network time zone setting (PUBLISHER). If source is PROVIDED, the time_zone
field in the report definition must also set a time zone.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [TimeZoneSource](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.TimeZoneSource). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTimeZone

Optional. If time_zone_source is PROVIDED, this is the time zone to use for
this report. Leave empty for any other time zone source. Time zone in IANA
format. For example, "America/New_York".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setTimeZone

Optional. If time_zone_source is PROVIDED, this is the time zone to use for
this report. Leave empty for any other time zone source. Time zone in IANA
format. For example, "America/New_York".

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCurrencyCode

Optional. The ISO 4217 currency code for this report. Defaults to publisher
currency code if not specified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setCurrencyCode

Optional. The ISO 4217 currency code for this report. Defaults to publisher
currency code if not specified.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDateRange

Required. The primary date range of this report.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.DateRange|null` |   |

### hasDateRange

### clearDateRange

### setDateRange

Required. The primary date range of this report.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.DateRange` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getComparisonDateRange

Optional. The comparison date range of this report. If unspecified, the
report won't have any comparison metrics.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.DateRange|null` |   |

### hasComparisonDateRange

### clearComparisonDateRange

### setComparisonDateRange

Optional. The comparison date range of this report. If unspecified, the
report won't have any comparison metrics.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.DateRange` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCmsMetadataDimensionKeyIds

Optional. CMS Metadata Dimension keys that represent
CMS_METADATA_DIMENSION_\* dimensions. The index of this repeated field
corresponds to the index on each dimension. For example,
cms_metadata_dimension_key_ids\[0\] describes
CMS_METADATA_DIMENSION_0_VALUE_ID and CMS_METADATA_DIMENSION_0_VALUE.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<int>|Google\Protobuf\RepeatedField<string>` |   |

### setCmsMetadataDimensionKeyIds

Optional. CMS Metadata Dimension keys that represent
CMS_METADATA_DIMENSION_\* dimensions. The index of this repeated field
corresponds to the index on each dimension. For example,
cms_metadata_dimension_key_ids\[0\] describes
CMS_METADATA_DIMENSION_0_VALUE_ID and CMS_METADATA_DIMENSION_0_VALUE.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]|string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCustomDimensionKeyIds

Optional. Custom Dimension keys that represent CUSTOM_DIMENSION_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, custom_dimension_key_ids\[0\] describes
CUSTOM_DIMENSION_0_VALUE_ID and CUSTOM_DIMENSION_0_VALUE.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<int>|Google\Protobuf\RepeatedField<string>` |   |

### setCustomDimensionKeyIds

Optional. Custom Dimension keys that represent CUSTOM_DIMENSION_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, custom_dimension_key_ids\[0\] describes
CUSTOM_DIMENSION_0_VALUE_ID and CUSTOM_DIMENSION_0_VALUE.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]|string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEkvDimensionKeyIds

Optional. Enhanced Key-values Dimension keys that represent EKV_DIMENSION_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, ekv_dimension_key_ids\[0\] describes
EKV_DIMENSION_0_VALUE_ID and EKV_DIMENSION_0_VALUE.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<int>|Google\Protobuf\RepeatedField<string>` |   |

### setEkvDimensionKeyIds

Optional. Enhanced Key-values Dimension keys that represent EKV_DIMENSION_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, ekv_dimension_key_ids\[0\] describes
EKV_DIMENSION_0_VALUE_ID and EKV_DIMENSION_0_VALUE.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]|string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLineItemCustomFieldIds

Optional. Custom field IDs that represent LINE_ITEM_CUSTOM_FIELD_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, line_item_custom_field_ids\[0\] describes
LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID and LINE_ITEM_CUSTOM_FIELD_0_VALUE.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<int>|Google\Protobuf\RepeatedField<string>` |   |

### setLineItemCustomFieldIds

Optional. Custom field IDs that represent LINE_ITEM_CUSTOM_FIELD_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, line_item_custom_field_ids\[0\] describes
LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID and LINE_ITEM_CUSTOM_FIELD_0_VALUE.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]|string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getOrderCustomFieldIds

Optional. Custom field IDs that represent ORDER_CUSTOM_FIELD_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, order_custom_field_ids\[0\] describes
ORDER_CUSTOM_FIELD_0_OPTION_ID and ORDER_CUSTOM_FIELD_0_VALUE.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<int>|Google\Protobuf\RepeatedField<string>` |   |

### setOrderCustomFieldIds

Optional. Custom field IDs that represent ORDER_CUSTOM_FIELD_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, order_custom_field_ids\[0\] describes
ORDER_CUSTOM_FIELD_0_OPTION_ID and ORDER_CUSTOM_FIELD_0_VALUE.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]|string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreativeCustomFieldIds

Optional. Custom field IDs that represent CREATIVE_CUSTOM_FIELD_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, creative_custom_field_ids\[0\] describes
CREATIVE_CUSTOM_FIELD_0_OPTION_ID and CREATIVE_CUSTOM_FIELD_0_VALUE.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<int>|Google\Protobuf\RepeatedField<string>` |   |

### setCreativeCustomFieldIds

Optional. Custom field IDs that represent CREATIVE_CUSTOM_FIELD_\*
dimensions. The index of this repeated field corresponds to the index on
each dimension. For example, creative_custom_field_ids\[0\] describes
CREATIVE_CUSTOM_FIELD_0_OPTION_ID and CREATIVE_CUSTOM_FIELD_0_VALUE.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]|string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReportType

Required. The type of this report.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ReportType](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.ReportType). |

### setReportType

Required. The type of this report.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ReportType](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.ReportType). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTimePeriodColumn

Optional. Include a time period column to introduce comparison columns in
the report for each generated period. For example, set to "QUARTERS" here
to have a column for each quarter present in the primary date range. If
"PREVIOUS PERIOD" is specified in comparison_date_range, then each quarter
column will also include comparison values for its relative previous
quarter.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [TimePeriodColumn](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.TimePeriodColumn). |

### setTimePeriodColumn

Optional. Include a time period column to introduce comparison columns in
the report for each generated period. For example, set to "QUARTERS" here
to have a column for each quarter present in the primary date range. If
"PREVIOUS PERIOD" is specified in comparison_date_range, then each quarter
column will also include comparison values for its relative previous
quarter.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [TimePeriodColumn](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.TimePeriodColumn). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFlags

Optional. List of flags for this report. Used to flag rows in a result set
based on a set of defined filters.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.Flag>` |   |

### setFlags

Optional. List of flags for this report. Used to flag rows in a result set
based on a set of defined filters.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.Flag>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSorts

Optional. Default sorts to apply to this report.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.Sort>` |   |

### setSorts

Optional. Default sorts to apply to this report.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ReportDefinition.Sort>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getExpandedCompatibility

Optional. Whether to use expanded compatibility for this report.

If true, this setting enables certain combinations of dimensions and
metrics for this report that would otherwise be incompatible. Enabling this
will collapse reservation data into a single row even if the report's
dimensions would normally result in multiple rows for reservation data.
This impacts dimensions related to line items, orders, creatives, and
advertisers.
This is equivalent to the "Access more dimension and metric combinations"
setting in the Interactive Reports UI. For more details, see:
<https://support.google.com/admanager/answer/16865393#combinations>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setExpandedCompatibility

Optional. Whether to use expanded compatibility for this report.

If true, this setting enables certain combinations of dimensions and
metrics for this report that would otherwise be incompatible. Enabling this
will collapse reservation data into a single row even if the report's
dimensions would normally result in multiple rows for reservation data.
This impacts dimensions related to line items, orders, creatives, and
advertisers.
This is equivalent to the "Access more dimension and metric combinations"
setting in the Interactive Reports UI. For more details, see:
<https://support.google.com/admanager/answer/16865393#combinations>

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |