Class: Google::Apis::AnalyticsreportingV4::ReportRequest
- Inherits:
-
Object
- Object
- Google::Apis::AnalyticsreportingV4::ReportRequest
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/analyticsreporting_v4/classes.rb,
generated/google/apis/analyticsreporting_v4/representations.rb,
generated/google/apis/analyticsreporting_v4/representations.rb
Overview
The main request class which specifies the Reporting API request.
Instance Attribute Summary collapse
-
#cohort_group ⇒ Google::Apis::AnalyticsreportingV4::CohortGroup
Defines a cohort group.
-
#date_ranges ⇒ Array<Google::Apis::AnalyticsreportingV4::DateRange>
Date ranges in the request.
-
#dimension_filter_clauses ⇒ Array<Google::Apis::AnalyticsreportingV4::DimensionFilterClause>
The dimension filter clauses for filtering Dimension Values.
-
#dimensions ⇒ Array<Google::Apis::AnalyticsreportingV4::Dimension>
The dimensions requested.
-
#filters_expression ⇒ String
Dimension or metric filters that restrict the data returned for your request.
-
#hide_totals ⇒ Boolean
(also: #hide_totals?)
If set to true, hides the total of all metrics for all the matching rows, for every date range.
-
#hide_value_ranges ⇒ Boolean
(also: #hide_value_ranges?)
If set to true, hides the minimum and maximum across all matching rows.
-
#include_empty_rows ⇒ Boolean
(also: #include_empty_rows?)
If set to false, the response does not include rows if all the retrieved metrics are equal to zero.
-
#metric_filter_clauses ⇒ Array<Google::Apis::AnalyticsreportingV4::MetricFilterClause>
The metric filter clauses.
-
#metrics ⇒ Array<Google::Apis::AnalyticsreportingV4::Metric>
The metrics requested.
-
#order_bys ⇒ Array<Google::Apis::AnalyticsreportingV4::OrderBy>
Sort order on output rows.
-
#page_size ⇒ Fixnum
Page size is for paging and specifies the maximum number of returned rows.
-
#page_token ⇒ String
A continuation token to get the next page of the results.
-
#pivots ⇒ Array<Google::Apis::AnalyticsreportingV4::Pivot>
The pivot definitions.
-
#sampling_level ⇒ String
The desired report sample size.
-
#segments ⇒ Array<Google::Apis::AnalyticsreportingV4::Segment>
Segment the data returned for the request.
-
#view_id ⇒ String
The Analytics view ID from which to retrieve data.
Instance Method Summary collapse
-
#initialize(**args) ⇒ ReportRequest
constructor
A new instance of ReportRequest.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ ReportRequest
Returns a new instance of ReportRequest
1470 1471 1472 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1470 def initialize(**args) update!(**args) end |
Instance Attribute Details
#cohort_group ⇒ Google::Apis::AnalyticsreportingV4::CohortGroup
Defines a cohort group.
For example:
"cohortGroup":
"cohorts": [
"name": "cohort 1",
"type": "FIRST_VISIT_DATE",
"dateRange": "startDate": "2015-08-01", "endDate": "2015-08-01"
,
"name": "cohort 2"
"type": "FIRST_VISIT_DATE"
"dateRange": "startDate": "2015-07-01", "endDate": "2015-07-01"
]
Corresponds to the JSON property cohortGroup
1329 1330 1331 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1329 def cohort_group @cohort_group end |
#date_ranges ⇒ Array<Google::Apis::AnalyticsreportingV4::DateRange>
Date ranges in the request. The request can have a maximum of 2 date
ranges. The response will contain a set of metric values for each
combination of the dimensions for each date range in the request. So, if
there are two date ranges, there will be two set of metric values, one for
the original date range and one for the second date range.
The reportRequest.dateRanges
field should not be specified for cohorts
or Lifetime value requests.
If a date range is not provided, the default date range is (startDate:
current date - 7 days, endDate: current date - 1 day). Every
ReportRequest within a batchGet
method must
contain the same dateRanges
definition.
Corresponds to the JSON property dateRanges
1344 1345 1346 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1344 def date_ranges @date_ranges end |
#dimension_filter_clauses ⇒ Array<Google::Apis::AnalyticsreportingV4::DimensionFilterClause>
The dimension filter clauses for filtering Dimension Values. They are
logically combined with the AND
operator. Note that filtering occurs
before any dimensions are aggregated, so that the returned metrics
represent the total for only the relevant dimensions.
Corresponds to the JSON property dimensionFilterClauses
1352 1353 1354 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1352 def dimension_filter_clauses @dimension_filter_clauses end |
#dimensions ⇒ Array<Google::Apis::AnalyticsreportingV4::Dimension>
The dimensions requested.
Requests can have a total of 9 dimensions.
Corresponds to the JSON property dimensions
1358 1359 1360 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1358 def dimensions @dimensions end |
#filters_expression ⇒ String
Dimension or metric filters that restrict the data returned for your
request. To use the filtersExpression
, supply a dimension or metric on
which to filter, followed by the filter expression. For example, the
following expression selects ga:browser
dimension which starts with
Firefox; ga:browser=~^Firefox
. For more information on dimensions
and metric filters, see
Filters
reference.
Corresponds to the JSON property filtersExpression
1371 1372 1373 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1371 def filters_expression @filters_expression end |
#hide_totals ⇒ Boolean Also known as: hide_totals?
If set to true, hides the total of all metrics for all the matching rows,
for every date range. The default false and will return the totals.
Corresponds to the JSON property hideTotals
1377 1378 1379 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1377 def hide_totals @hide_totals end |
#hide_value_ranges ⇒ Boolean Also known as: hide_value_ranges?
If set to true, hides the minimum and maximum across all matching rows.
The default is false and the value ranges are returned.
Corresponds to the JSON property hideValueRanges
1384 1385 1386 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1384 def hide_value_ranges @hide_value_ranges end |
#include_empty_rows ⇒ Boolean Also known as: include_empty_rows?
If set to false, the response does not include rows if all the retrieved
metrics are equal to zero. The default is false which will exclude these
rows.
Corresponds to the JSON property includeEmptyRows
1392 1393 1394 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1392 def include_empty_rows @include_empty_rows end |
#metric_filter_clauses ⇒ Array<Google::Apis::AnalyticsreportingV4::MetricFilterClause>
The metric filter clauses. They are logically combined with the AND
operator. Metric filters look at only the first date range and not the
comparing date range. Note that filtering on metrics occurs after the
metrics are aggregated.
Corresponds to the JSON property metricFilterClauses
1401 1402 1403 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1401 def metric_filter_clauses @metric_filter_clauses end |
#metrics ⇒ Array<Google::Apis::AnalyticsreportingV4::Metric>
The metrics requested.
Requests must specify at least one metric. Requests can have a
total of 10 metrics.
Corresponds to the JSON property metrics
1408 1409 1410 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1408 def metrics @metrics end |
#order_bys ⇒ Array<Google::Apis::AnalyticsreportingV4::OrderBy>
Sort order on output rows. To compare two rows, the elements of the
following are applied in order until a difference is found. All date
ranges in the output get the same row order.
Corresponds to the JSON property orderBys
1415 1416 1417 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1415 def order_bys @order_bys end |
#page_size ⇒ Fixnum
Page size is for paging and specifies the maximum number of returned rows.
Page size should be >= 0. A query returns the default of 1,000 rows.
The Analytics Core Reporting API returns a maximum of 100,000 rows per
request, no matter how many you ask for. It can also return fewer rows
than requested, if there aren't as many dimension segments as you expect.
For instance, there are fewer than 300 possible values for ga:country
,
so when segmenting only by country, you can't get more than 300 rows,
even if you set pageSize
to a higher value.
Corresponds to the JSON property pageSize
1427 1428 1429 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1427 def page_size @page_size end |
#page_token ⇒ String
A continuation token to get the next page of the results. Adding this to
the request will return the rows after the pageToken. The pageToken should
be the value returned in the nextPageToken parameter in the response to
the GetReports request.
Corresponds to the JSON property pageToken
1435 1436 1437 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1435 def page_token @page_token end |
#pivots ⇒ Array<Google::Apis::AnalyticsreportingV4::Pivot>
The pivot definitions. Requests can have a maximum of 2 pivots.
Corresponds to the JSON property pivots
1440 1441 1442 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1440 def pivots @pivots end |
#sampling_level ⇒ String
The desired report
sample size.
If the the samplingLevel
field is unspecified the DEFAULT
sampling
level is used. Every ReportRequest within a
batchGet
method must contain the same samplingLevel
definition. See
developer guide
for details.
Corresponds to the JSON property samplingLevel
1451 1452 1453 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1451 def sampling_level @sampling_level end |
#segments ⇒ Array<Google::Apis::AnalyticsreportingV4::Segment>
Segment the data returned for the request. A segment definition helps look
at a subset of the segment request. A request can contain up to four
segments. Every ReportRequest within a
batchGet
method must contain the same segments
definition. Requests
with segments must have the ga:segment
dimension.
Corresponds to the JSON property segments
1460 1461 1462 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1460 def segments @segments end |
#view_id ⇒ String
The Analytics
view ID
from which to retrieve data. Every ReportRequest
within a batchGet
method must contain the same viewId
.
Corresponds to the JSON property viewId
1468 1469 1470 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1468 def view_id @view_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1475 def update!(**args) @cohort_group = args[:cohort_group] if args.key?(:cohort_group) @date_ranges = args[:date_ranges] if args.key?(:date_ranges) @dimension_filter_clauses = args[:dimension_filter_clauses] if args.key?(:dimension_filter_clauses) @dimensions = args[:dimensions] if args.key?(:dimensions) @filters_expression = args[:filters_expression] if args.key?(:filters_expression) @hide_totals = args[:hide_totals] if args.key?(:hide_totals) @hide_value_ranges = args[:hide_value_ranges] if args.key?(:hide_value_ranges) @include_empty_rows = args[:include_empty_rows] if args.key?(:include_empty_rows) @metric_filter_clauses = args[:metric_filter_clauses] if args.key?(:metric_filter_clauses) @metrics = args[:metrics] if args.key?(:metrics) @order_bys = args[:order_bys] if args.key?(:order_bys) @page_size = args[:page_size] if args.key?(:page_size) @page_token = args[:page_token] if args.key?(:page_token) @pivots = args[:pivots] if args.key?(:pivots) @sampling_level = args[:sampling_level] if args.key?(:sampling_level) @segments = args[:segments] if args.key?(:segments) @view_id = args[:view_id] if args.key?(:view_id) end |