Reference documentation and code samples for the Google Analytics Admin V1alpha Client class CalculatedMetric.
A definition for a calculated metric.
Generated from protobuf message google.analytics.admin.v1alpha.CalculatedMetric
Namespace
Google \ Analytics \ Admin \ V1alphaMethods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ name
string
Output only. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
↳ description
string
Optional. Description for this calculated metric. Max length of 4096 characters.
↳ display_name
string
Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.
↳ calculated_metric_id
string
Output only. The ID to use for the calculated metric. In the UI, this is referred to as the "API name." The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, "calcMetric:{calculated_metric_id}".
↳ metric_unit
int
Required. The type for the calculated metric's value.
↳ restricted_metric_type
array
Output only. Types of restricted data that this metric contains.
↳ formula
string
Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations: + (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number). Example formula: "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
↳ invalid_metric_reference
bool
Output only. If true, this calculated metric has a invalid metric reference. Anything using a calculated metric with invalid_metric_reference set to true may fail, produce warnings, or produce unexpected results.
getName
Output only. Resource name for this CalculatedMetric.
Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
string
setName
Output only. Resource name for this CalculatedMetric.
Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
var
string
$this
getDescription
Optional. Description for this calculated metric.
Max length of 4096 characters.
string
setDescription
Optional. Description for this calculated metric.
Max length of 4096 characters.
var
string
$this
getDisplayName
Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.
string
setDisplayName
Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.
var
string
$this
getCalculatedMetricId
Output only. The ID to use for the calculated metric. In the UI, this is referred to as the "API name." The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, "calcMetric:{calculated_metric_id}".
string
setCalculatedMetricId
Output only. The ID to use for the calculated metric. In the UI, this is referred to as the "API name." The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, "calcMetric:{calculated_metric_id}".
var
string
$this
getMetricUnit
Required. The type for the calculated metric's value.
int
setMetricUnit
Required. The type for the calculated metric's value.
var
int
$this
getRestrictedMetricType
Output only. Types of restricted data that this metric contains.
setRestrictedMetricType
Output only. Types of restricted data that this metric contains.
var
int[]
$this
getFormula
Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations:
- (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number).
Example formula: "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
string
setFormula
Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations:
- (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number).
Example formula: "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
var
string
$this
getInvalidMetricReference
Output only. If true, this calculated metric has a invalid metric reference. Anything using a calculated metric with invalid_metric_reference set to true may fail, produce warnings, or produce unexpected results.
bool
setInvalidMetricReference
Output only. If true, this calculated metric has a invalid metric reference. Anything using a calculated metric with invalid_metric_reference set to true may fail, produce warnings, or produce unexpected results.
var
bool
$this