The name of the metric. See the API Metrics for the list of metric names.
If expression is specified, name can be any string that you would like. For example if expression is screenPageViews/sessions, you could call that metric's name = viewsPerSession.
Metrics are referenced by name in metricFilter, orderBys, and metric expression.
expression
string
A mathematical expression for derived metrics. For example, the metric Event count per user is eventCount/totalUsers.
invisible
boolean
Indicates if a metric is invisible in the report response. If a metric is invisible, the metric will not produce a column in the response, but can be used in metricFilter, orderBys, or a metric expression.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eMetrics quantify report data, such as the total events using \u003ccode\u003eeventCount\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eMetrics are defined by their \u003ccode\u003ename\u003c/code\u003e, an optional \u003ccode\u003eexpression\u003c/code\u003e for calculations, and an \u003ccode\u003einvisible\u003c/code\u003e property to control visibility.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the API Metrics documentation for predefined metric names and usage in filters, ordering, and expressions.\u003c/p\u003e\n"],["\u003cp\u003eCustom metric names can be used when defining them with \u003ccode\u003eexpression\u003c/code\u003e, enabling flexibility in analysis.\u003c/p\u003e\n"]]],["The document defines report metrics, which are quantitative measurements like `eventCount`. Reports can include up to 10 metrics. Each metric has a `name` (string), which can be custom if an `expression` (a mathematical string) is used for derived metrics. An `invisible` boolean property can hide a metric from the report's columns while still allowing its use in filters, ordering, or other expressions.\n"],null,["# Metric\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\nThe quantitative measurements of a report. For example, the metric `eventCount` is the total number of events. Requests are allowed up to 10 metrics.\n\n| JSON representation ||\n|------------------------------------------------------------------------|---|\n| ``` { \"name\": string, \"expression\": string, \"invisible\": boolean } ``` |\n\n| Fields ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` The name of the metric. See the [API Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) for the list of metric names. If `expression` is specified, `name` can be any string that you would like. For example if `expression` is `screenPageViews/sessions`, you could call that metric's name = `viewsPerSession`. Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric `expression`. |\n| `expression` | `string` A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`. |\n| `invisible` | `boolean` Indicates if a metric is invisible in the report response. If a metric is invisible, the metric will not produce a column in the response, but can be used in `metricFilter`, `orderBys`, or a metric `expression`. |"]]