# Google Analytics Data V1beta API - Class Google::Analytics::Data::V1beta::AnalyticsData::Client (v0.4.3)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.4.3 (latest)](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client)
- [0.4.2](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/0.4.2/Google-Analytics-Data-V1beta-AnalyticsData-Client)
Reference documentation and code samples for the Google Analytics Data V1beta API class Google::Analytics::Data::V1beta::AnalyticsData::Client.

Client for the AnalyticsData service.


<br />

Google Analytics reporting data service.

## Inherits

- Object

## Includes

- [Google::Analytics::Data::V1beta::AnalyticsData::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the AnalyticsData Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client-Configuration "Google::Analytics::Data::V1beta::AnalyticsData::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all AnalyticsData clients
::Google::Analytics::Data::V1beta::AnalyticsData::Client.configure do |config|
  config.timeout = 10.0
end
```

### #batch_run_pivot_reports

    def batch_run_pivot_reports(request, options = nil) -> ::Google::Analytics::Data::V1beta::BatchRunPivotReportsResponse
    def batch_run_pivot_reports(property: nil, requests: nil) -> ::Google::Analytics::Data::V1beta::BatchRunPivotReportsResponse

Returns multiple pivot reports in a batch. All reports must be for the same
GA4 Property.
**Overloads**

    def batch_run_pivot_reports(request, options = nil) -> ::Google::Analytics::Data::V1beta::BatchRunPivotReportsResponse

Pass arguments to `batch_run_pivot_reports` via a request object, either of type [BatchRunPivotReportsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-BatchRunPivotReportsRequest "Google::Analytics::Data::V1beta::BatchRunPivotReportsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Analytics::Data::V1beta::BatchRunPivotReportsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-BatchRunPivotReportsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def batch_run_pivot_reports(property: nil, requests: nil) -> ::Google::Analytics::Data::V1beta::BatchRunPivotReportsResponse

Pass arguments to `batch_run_pivot_reports` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **property** (::String) --- A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to
  find your Property
  ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). This property must be specified for the batch. The property within RunPivotReportRequest may either be unspecified or consistent with this property.


  Example: properties/1234
- **requests** (::Array\<[::Google::Analytics::Data::V1beta::RunPivotReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunPivotReportRequest), ::Hash\>) --- Individual requests. Each request has a separate pivot report response. Each batch request is allowed up to 5 requests.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Analytics::Data::V1beta::BatchRunPivotReportsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-BatchRunPivotReportsResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Analytics::Data::V1beta::BatchRunPivotReportsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-BatchRunPivotReportsResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/analytics/data/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Analytics::Data::V1beta::BatchRunPivotReportsRequest.new

# Call the batch_run_pivot_reports method.
result = client.batch_run_pivot_reports request

# The returned object is of type Google::Analytics::Data::V1beta::BatchRunPivotReportsResponse.
p result
```

### #batch_run_reports

    def batch_run_reports(request, options = nil) -> ::Google::Analytics::Data::V1beta::BatchRunReportsResponse
    def batch_run_reports(property: nil, requests: nil) -> ::Google::Analytics::Data::V1beta::BatchRunReportsResponse

Returns multiple reports in a batch. All reports must be for the same
GA4 Property.
**Overloads**

    def batch_run_reports(request, options = nil) -> ::Google::Analytics::Data::V1beta::BatchRunReportsResponse

Pass arguments to `batch_run_reports` via a request object, either of type [BatchRunReportsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-BatchRunReportsRequest "Google::Analytics::Data::V1beta::BatchRunReportsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Analytics::Data::V1beta::BatchRunReportsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-BatchRunReportsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def batch_run_reports(property: nil, requests: nil) -> ::Google::Analytics::Data::V1beta::BatchRunReportsResponse

Pass arguments to `batch_run_reports` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **property** (::String) --- A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to
  find your Property
  ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). This property must be specified for the batch. The property within RunReportRequest may either be unspecified or consistent with this property.


  Example: properties/1234
- **requests** (::Array\<[::Google::Analytics::Data::V1beta::RunReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunReportRequest), ::Hash\>) --- Individual requests. Each request has a separate report response. Each batch request is allowed up to 5 requests.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Analytics::Data::V1beta::BatchRunReportsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-BatchRunReportsResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Analytics::Data::V1beta::BatchRunReportsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-BatchRunReportsResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/analytics/data/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Analytics::Data::V1beta::BatchRunReportsRequest.new

# Call the batch_run_reports method.
result = client.batch_run_reports request

# The returned object is of type Google::Analytics::Data::V1beta::BatchRunReportsResponse.
p result
```

### #check_compatibility

    def check_compatibility(request, options = nil) -> ::Google::Analytics::Data::V1beta::CheckCompatibilityResponse
    def check_compatibility(property: nil, dimensions: nil, metrics: nil, dimension_filter: nil, metric_filter: nil, compatibility_filter: nil) -> ::Google::Analytics::Data::V1beta::CheckCompatibilityResponse

This compatibility method lists dimensions and metrics that can be added to
a report request and maintain compatibility. This method fails if the
request's dimensions and metrics are incompatible.


In Google Analytics, reports fail if they request incompatible dimensions
and/or metrics; in that case, you will need to remove dimensions and/or
metrics from the incompatible report until the report is compatible.

<br />

The Realtime and Core reports have different compatibility rules. This
method checks compatibility for Core reports.
**Overloads**

    def check_compatibility(request, options = nil) -> ::Google::Analytics::Data::V1beta::CheckCompatibilityResponse

Pass arguments to `check_compatibility` via a request object, either of type [CheckCompatibilityRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-CheckCompatibilityRequest "Google::Analytics::Data::V1beta::CheckCompatibilityRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Analytics::Data::V1beta::CheckCompatibilityRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-CheckCompatibilityRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def check_compatibility(property: nil, dimensions: nil, metrics: nil, dimension_filter: nil, metric_filter: nil, compatibility_filter: nil) -> ::Google::Analytics::Data::V1beta::CheckCompatibilityResponse

Pass arguments to `check_compatibility` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **property** (::String) --- A Google Analytics GA4 property identifier whose events are tracked. To learn more, see [where to find your Property
  ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). `property` should be the same value as in your `runReport` request.


  Example: properties/1234

  Set the Property ID to 0 for compatibility checking on dimensions and
  metrics common to all properties. In this special mode, this method will
  not return custom dimensions and metrics.
- **dimensions** (::Array\<[::Google::Analytics::Data::V1beta::Dimension](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Dimension), ::Hash\>) --- The dimensions in this report. `dimensions` should be the same value as in your `runReport` request.
- **metrics** (::Array\<[::Google::Analytics::Data::V1beta::Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Metric), ::Hash\>) --- The metrics in this report. `metrics` should be the same value as in your `runReport` request.
- **dimension_filter** ([::Google::Analytics::Data::V1beta::FilterExpression](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-FilterExpression), ::Hash) --- The filter clause of dimensions. `dimensionFilter` should be the same value as in your `runReport` request.
- **metric_filter** ([::Google::Analytics::Data::V1beta::FilterExpression](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-FilterExpression), ::Hash) --- The filter clause of metrics. `metricFilter` should be the same value as in your `runReport` request
- **compatibility_filter** ([::Google::Analytics::Data::V1beta::Compatibility](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Compatibility)) --- Filters the dimensions and metrics in the response to just this compatibility. Commonly used as `"compatibilityFilter": "COMPATIBLE"` to only return compatible dimensions \& metrics.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Analytics::Data::V1beta::CheckCompatibilityResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-CheckCompatibilityResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Analytics::Data::V1beta::CheckCompatibilityResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-CheckCompatibilityResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/analytics/data/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Analytics::Data::V1beta::CheckCompatibilityRequest.new

# Call the check_compatibility method.
result = client.check_compatibility request

# The returned object is of type Google::Analytics::Data::V1beta::CheckCompatibilityResponse.
p result
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the AnalyticsData Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client#Google__Analytics__Data__V1beta__AnalyticsData__Client_configure_class_ "Google::Analytics::Data::V1beta::AnalyticsData::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client-Configuration "Google::Analytics::Data::V1beta::AnalyticsData::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client-Configuration))

### #get_metadata

    def get_metadata(request, options = nil) -> ::Google::Analytics::Data::V1beta::Metadata
    def get_metadata(name: nil) -> ::Google::Analytics::Data::V1beta::Metadata

Returns metadata for dimensions and metrics available in reporting methods.
Used to explore the dimensions and metrics. In this method, a Google
Analytics GA4 Property Identifier is specified in the request, and
the metadata response includes Custom dimensions and metrics as well as
Universal metadata.


<br />

For example if a custom metric with parameter name `levels_unlocked` is
registered to a property, the Metadata response will contain
`customEvent:levels_unlocked`. Universal metadata are dimensions and
metrics applicable to any property such as `country` and `totalUsers`.
**Overloads**

    def get_metadata(request, options = nil) -> ::Google::Analytics::Data::V1beta::Metadata

Pass arguments to `get_metadata` via a request object, either of type [GetMetadataRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-GetMetadataRequest "Google::Analytics::Data::V1beta::GetMetadataRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Analytics::Data::V1beta::GetMetadataRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-GetMetadataRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_metadata(name: nil) -> ::Google::Analytics::Data::V1beta::Metadata

Pass arguments to `get_metadata` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see [where to find
  your Property
  ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).


  Example: properties/1234/metadata

  Set the Property ID to 0 for dimensions and metrics common to all
  properties. In this special mode, this method will not return custom
  dimensions and metrics.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Analytics::Data::V1beta::Metadata](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Metadata))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Analytics::Data::V1beta::Metadata](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Metadata))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/analytics/data/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Analytics::Data::V1beta::GetMetadataRequest.new

# Call the get_metadata method.
result = client.get_metadata request

# The returned object is of type Google::Analytics::Data::V1beta::Metadata.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new AnalyticsData client object.
**Yields**

- (config) --- Configure the AnalyticsData client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Analytics::Data::V1beta::AnalyticsData::Client.new

# Create a client using a custom configuration
client = ::Google::Analytics::Data::V1beta::AnalyticsData::Client.new do |config|
  config.timeout = 10.0
end
```

### #run_pivot_report

    def run_pivot_report(request, options = nil) -> ::Google::Analytics::Data::V1beta::RunPivotReportResponse
    def run_pivot_report(property: nil, dimensions: nil, metrics: nil, date_ranges: nil, pivots: nil, dimension_filter: nil, metric_filter: nil, currency_code: nil, cohort_spec: nil, keep_empty_rows: nil, return_property_quota: nil) -> ::Google::Analytics::Data::V1beta::RunPivotReportResponse

Returns a customized pivot report of your Google Analytics event data.
Pivot reports are more advanced and expressive formats than regular
reports. In a pivot report, dimensions are only visible if they are
included in a pivot. Multiple pivots can be specified to further dissect
your data.
**Overloads**

    def run_pivot_report(request, options = nil) -> ::Google::Analytics::Data::V1beta::RunPivotReportResponse

Pass arguments to `run_pivot_report` via a request object, either of type [RunPivotReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunPivotReportRequest "Google::Analytics::Data::V1beta::RunPivotReportRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Analytics::Data::V1beta::RunPivotReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunPivotReportRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def run_pivot_report(property: nil, dimensions: nil, metrics: nil, date_ranges: nil, pivots: nil, dimension_filter: nil, metric_filter: nil, currency_code: nil, cohort_spec: nil, keep_empty_rows: nil, return_property_quota: nil) -> ::Google::Analytics::Data::V1beta::RunPivotReportResponse

Pass arguments to `run_pivot_report` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **property** (::String) --- A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to
  find your Property
  ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Within a batch request, this property should either be unspecified or consistent with the batch-level property.


  Example: properties/1234
- **dimensions** (::Array\<[::Google::Analytics::Data::V1beta::Dimension](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Dimension), ::Hash\>) --- The dimensions requested. All defined dimensions must be used by one of the following: dimension_expression, dimension_filter, pivots, order_bys.
- **metrics** (::Array\<[::Google::Analytics::Data::V1beta::Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Metric), ::Hash\>) --- The metrics requested, at least one metric needs to be specified. All defined metrics must be used by one of the following: metric_expression, metric_filter, order_bys.
- **date_ranges** (::Array\<[::Google::Analytics::Data::V1beta::DateRange](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-DateRange), ::Hash\>) --- The date range to retrieve event data for the report. If multiple date ranges are specified, event data from each date range is used in the report. A special dimension with field name "dateRange" can be included in a Pivot's field names; if included, the report compares between date ranges. In a cohort request, this `dateRanges` must be unspecified.
- **pivots** (::Array\<[::Google::Analytics::Data::V1beta::Pivot](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Pivot), ::Hash\>) --- Describes the visual format of the report's dimensions in columns or rows. The union of the fieldNames (dimension names) in all pivots must be a subset of dimension names defined in Dimensions. No two pivots can share a dimension. A dimension is only visible if it appears in a pivot.
- **dimension_filter** ([::Google::Analytics::Data::V1beta::FilterExpression](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-FilterExpression), ::Hash) --- The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.
- **metric_filter** ([::Google::Analytics::Data::V1beta::FilterExpression](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-FilterExpression), ::Hash) --- The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.
- **currency_code** (::String) --- 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_spec** ([::Google::Analytics::Data::V1beta::CohortSpec](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-CohortSpec), ::Hash) --- Cohort group associated with this request. If there is a cohort group in the request the 'cohort' dimension must be present.
- **keep_empty_rows** (::Boolean) --- 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.
- **return_property_quota** (::Boolean) --- Toggles whether to return the current state of this Analytics Property's quota. Quota is returned in [PropertyQuota](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client#PropertyQuota).
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Analytics::Data::V1beta::RunPivotReportResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunPivotReportResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Analytics::Data::V1beta::RunPivotReportResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunPivotReportResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/analytics/data/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Analytics::Data::V1beta::RunPivotReportRequest.new

# Call the run_pivot_report method.
result = client.run_pivot_report request

# The returned object is of type Google::Analytics::Data::V1beta::RunPivotReportResponse.
p result
```

### #run_realtime_report

    def run_realtime_report(request, options = nil) -> ::Google::Analytics::Data::V1beta::RunRealtimeReportResponse
    def run_realtime_report(property: nil, dimensions: nil, metrics: nil, dimension_filter: nil, metric_filter: nil, limit: nil, metric_aggregations: nil, order_bys: nil, return_property_quota: nil, minute_ranges: nil) -> ::Google::Analytics::Data::V1beta::RunRealtimeReportResponse

The Google Analytics Realtime API returns a customized report of realtime
event data for your property. These reports show events and usage from the
last 30 minutes.
**Overloads**

    def run_realtime_report(request, options = nil) -> ::Google::Analytics::Data::V1beta::RunRealtimeReportResponse

Pass arguments to `run_realtime_report` via a request object, either of type [RunRealtimeReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunRealtimeReportRequest "Google::Analytics::Data::V1beta::RunRealtimeReportRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Analytics::Data::V1beta::RunRealtimeReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunRealtimeReportRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def run_realtime_report(property: nil, dimensions: nil, metrics: nil, dimension_filter: nil, metric_filter: nil, limit: nil, metric_aggregations: nil, order_bys: nil, return_property_quota: nil, minute_ranges: nil) -> ::Google::Analytics::Data::V1beta::RunRealtimeReportResponse

Pass arguments to `run_realtime_report` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **property** (::String) --- A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to
  find your Property
  ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).


  Example: properties/1234
- **dimensions** (::Array\<[::Google::Analytics::Data::V1beta::Dimension](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Dimension), ::Hash\>) --- The dimensions requested and displayed.
- **metrics** (::Array\<[::Google::Analytics::Data::V1beta::Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Metric), ::Hash\>) --- The metrics requested and displayed.
- **dimension_filter** ([::Google::Analytics::Data::V1beta::FilterExpression](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-FilterExpression), ::Hash) --- The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.
- **metric_filter** ([::Google::Analytics::Data::V1beta::FilterExpression](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-FilterExpression), ::Hash) --- The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.
- **limit** (::Integer) --- The number of rows to return. If unspecified, 10,000 rows are returned. The API returns a maximum of 100,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_aggregations** (::Array\<[::Google::Analytics::Data::V1beta::MetricAggregation](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricAggregation)\>) --- Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to "RESERVED_(MetricAggregation)".
- **order_bys** (::Array\<[::Google::Analytics::Data::V1beta::OrderBy](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-OrderBy), ::Hash\>) --- Specifies how rows are ordered in the response.
- **return_property_quota** (::Boolean) --- Toggles whether to return the current state of this Analytics Property's Realtime quota. Quota is returned in [PropertyQuota](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client#PropertyQuota).
- **minute_ranges** (::Array\<[::Google::Analytics::Data::V1beta::MinuteRange](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MinuteRange), ::Hash\>) --- The minute ranges of event data to read. If unspecified, one minute range for the last 30 minutes will be used. If multiple minute ranges are requested, each response row will contain a zero based minute range index. If two minute ranges overlap, the event data for the overlapping minutes is included in the response rows for both minute ranges.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Analytics::Data::V1beta::RunRealtimeReportResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunRealtimeReportResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Analytics::Data::V1beta::RunRealtimeReportResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunRealtimeReportResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/analytics/data/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Analytics::Data::V1beta::RunRealtimeReportRequest.new

# Call the run_realtime_report method.
result = client.run_realtime_report request

# The returned object is of type Google::Analytics::Data::V1beta::RunRealtimeReportResponse.
p result
```

### #run_report

    def run_report(request, options = nil) -> ::Google::Analytics::Data::V1beta::RunReportResponse
    def run_report(property: nil, dimensions: nil, metrics: nil, date_ranges: nil, dimension_filter: nil, metric_filter: nil, offset: nil, limit: nil, metric_aggregations: nil, order_bys: nil, currency_code: nil, cohort_spec: nil, keep_empty_rows: nil, return_property_quota: nil) -> ::Google::Analytics::Data::V1beta::RunReportResponse

Returns a customized report of your Google Analytics event data. Reports
contain statistics derived from data collected by the Google Analytics
tracking code. The data returned from the API is as a table with columns
for the requested dimensions and metrics. Metrics are individual
measurements of user activity on your property, such as active users or
event count. Dimensions break down metrics across some common criteria,
such as country or event name.
**Overloads**

    def run_report(request, options = nil) -> ::Google::Analytics::Data::V1beta::RunReportResponse

Pass arguments to `run_report` via a request object, either of type [RunReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunReportRequest "Google::Analytics::Data::V1beta::RunReportRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Analytics::Data::V1beta::RunReportRequest](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunReportRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def run_report(property: nil, dimensions: nil, metrics: nil, date_ranges: nil, dimension_filter: nil, metric_filter: nil, offset: nil, limit: nil, metric_aggregations: nil, order_bys: nil, currency_code: nil, cohort_spec: nil, keep_empty_rows: nil, return_property_quota: nil) -> ::Google::Analytics::Data::V1beta::RunReportResponse

Pass arguments to `run_report` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **property** (::String) --- A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to
  find your Property
  ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Within a batch request, this property should either be unspecified or consistent with the batch-level property.


  Example: properties/1234
- **dimensions** (::Array\<[::Google::Analytics::Data::V1beta::Dimension](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Dimension), ::Hash\>) --- The dimensions requested and displayed.
- **metrics** (::Array\<[::Google::Analytics::Data::V1beta::Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Metric), ::Hash\>) --- The metrics requested and displayed.
- **date_ranges** (::Array\<[::Google::Analytics::Data::V1beta::DateRange](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-DateRange), ::Hash\>) --- 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_filter** ([::Google::Analytics::Data::V1beta::FilterExpression](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-FilterExpression), ::Hash) --- Dimension filters allow you to ask for only specific dimension values in the report. To learn more, see [Fundamentals of Dimension
  Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) for examples. Metrics cannot be used in this filter.
- **metric_filter** ([::Google::Analytics::Data::V1beta::FilterExpression](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-FilterExpression), ::Hash) --- The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Dimensions cannot be used in this filter.
- **offset** (::Integer) --- The row count of the start row. The first row is counted as row 0.


  When paging, the first request does not specify offset; or equivalently,
  sets offset to 0; the first request returns the first `limit` of rows. The
  second request sets offset to the `limit` of the first request; the second
  request returns the second `limit` of rows.

  To learn more about this pagination parameter, see
  [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
- **limit** (::Integer) --- The number of rows to return. If unspecified, 10,000 rows are returned. The API returns a maximum of 100,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.

  To learn more about this pagination parameter, see
  [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
- **metric_aggregations** (::Array\<[::Google::Analytics::Data::V1beta::MetricAggregation](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricAggregation)\>) --- Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to "RESERVED_(MetricAggregation)".
- **order_bys** (::Array\<[::Google::Analytics::Data::V1beta::OrderBy](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-OrderBy), ::Hash\>) --- Specifies how rows are ordered in the response.
- **currency_code** (::String) --- 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_spec** ([::Google::Analytics::Data::V1beta::CohortSpec](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-CohortSpec), ::Hash) --- Cohort group associated with this request. If there is a cohort group in the request the 'cohort' dimension must be present.
- **keep_empty_rows** (::Boolean) --- 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.
- **return_property_quota** (::Boolean) --- Toggles whether to return the current state of this Analytics Property's quota. Quota is returned in [PropertyQuota](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-AnalyticsData-Client#PropertyQuota).
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Analytics::Data::V1beta::RunReportResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunReportResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Analytics::Data::V1beta::RunReportResponse](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-RunReportResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/analytics/data/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Analytics::Data::V1beta::RunReportRequest.new

# Call the run_report method.
result = client.run_report request

# The returned object is of type Google::Analytics::Data::V1beta::RunReportResponse.
p result
```