Class: Google::Apis::AnalyticsreportingV4::Metric
- Inherits:
-
Object
- Object
- Google::Apis::AnalyticsreportingV4::Metric
- 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
Metrics
are the quantitative measurements. For example, the metric ga:users
indicates the total number of users for the requested time period.
Instance Attribute Summary collapse
-
#alias ⇒ String
An alias for the metric expression is an alternate name for the expression.
-
#expression ⇒ String
A metric expression in the request.
-
#formatting_type ⇒ String
Specifies how the metric expression should be formatted, for example
INTEGER.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Metric
constructor
A new instance of Metric.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ Metric
Returns a new instance of Metric
1357 1358 1359 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1357 def initialize(**args) update!(**args) end |
Instance Attribute Details
#alias ⇒ String
An alias for the metric expression is an alternate name for the
expression. The alias can be used for filtering and sorting. This field
is optional and is useful if the expression is not a single metric but
a complex expression which cannot be used in filtering and sorting.
The alias is also used in the response column header.
Corresponds to the JSON property alias
1337 1338 1339 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1337 def alias @alias end |
#expression ⇒ String
A metric expression in the request. An expression is constructed from one
or more metrics and numbers. Accepted operators include: Plus (+), Minus
(-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis,
Positive cardinal numbers (0-9), can include decimals and is limited to
1024 characters. Example ga:totalRefunds/ga:users, in most cases the
metric expression is just a single metric name like ga:users.
Adding mixed MetricType (E.g., CURRENCY + PERCENTAGE) metrics
will result in unexpected results.
Corresponds to the JSON property expression
1349 1350 1351 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1349 def expression @expression end |
#formatting_type ⇒ String
Specifies how the metric expression should be formatted, for example
INTEGER.
Corresponds to the JSON property formattingType
1355 1356 1357 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1355 def formatting_type @formatting_type end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1362 1363 1364 1365 1366 |
# File 'generated/google/apis/analyticsreporting_v4/classes.rb', line 1362 def update!(**args) @alias = args[:alias] if args.key?(:alias) @expression = args[:expression] if args.key?(:expression) @formatting_type = args[:formatting_type] if args.key?(:formatting_type) end |