TL;DR, Quick Answer
8 min readA GA4 calculated metric is a report metric defined by a formula over predefined metrics and custom metrics, created in Admin under Custom definitions by an editor or administrator. A standard property allows 5 and a 360 property allows 50. Formulas wrap metric names in curly brackets, use plus, minus, multiply, divide and parentheses, stop at 1,024 characters and cannot reference another calculated metric. The result appears in reports, explorations and the Google Analytics Data API.
What are GA4 calculated metrics?
Google Analytics 4 lets an editor create GA4 calculated metrics, which are new report metrics defined by a formula over existing predefined metrics and custom metrics, in Admin under Custom definitions. Google's help page describes them as metrics that "combine one or more existing metrics and/or custom metrics within a mathematical formula to produce a new and potentially more valuable metric." Its example is an Item margin metric built from the Item price standard metric and an Item COGS custom metric. Build one when a number your team quotes every week is a ratio or a difference that GA4 does not ship as a standard metric.
A calculated metric collects nothing new. It does arithmetic on numbers GA4 already holds, so every input has to exist as a metric before the formula can use it. If the input is a raw event parameter, such as a cost figure sent with a purchase, register it as a custom metric first. Custom metrics share the same Admin screen and quota table as the fields covered in GA4 custom dimensions.
How many calculated metrics can a GA4 property have?
A standard GA4 property allows 5 calculated metrics and a Google Analytics 360 property allows 50, according to Google's help page on creating them. The same figures appear in Google's custom definitions limits table, next to 50 custom metrics for a standard property and 125 for 360.
| Limit | Standard property | 360 property | Source |
|---|---|---|---|
| Calculated metrics per property | 5 | 50 | Analytics Help, create calculated metrics |
| Custom metrics per property | 50 | 125 | Analytics Help, custom dimensions and metrics |
| Unique custom metrics in one formula | 5 | 5 | Admin API, CalculatedMetric resource |
| Formula length | 1,024 characters | 1,024 characters | Analytics Help, create calculated metrics |
| Display name length | 82 characters | 82 characters | Admin API, CalculatedMetric resource |
| Calculated metrics inside another formula | Not allowed | Not allowed | Analytics Help, create calculated metrics |
Five slots on a standard property is a tight budget. Spend them on numbers that need your own logic and that more than one person checks. Admin shows how many you have created: on the Custom definitions page, Google says to "click Quota information on the top right."
What formula syntax do GA4 calculated metrics use?
A GA4 calculated metric formula wraps each metric name in single curly brackets, joins metrics and numbers with five operators, and stops at 1,024 characters. Google lists the accepted operators as minus (or negative), plus, multiplication, division and parentheses, written -, +, *, / and (). You can also type numbers and decimals, so {Purchase revenue} * 0.8 is a valid formula. The formula field suggests predefined metrics as you start typing a name.
The Admin API reference adds two rules the help page leaves out. A formula references at most 5 unique custom metrics, and any number in it has to fit in a 64-bit integer or a 64-bit floating point value. The API writes formulas with API names instead of bracketed display names. Its own example is ( customEvent:parameterName + cartPurchaseQuantity ) / 2.0.
The rule that catches most people is the ban on nesting. Google states: "You can't reference a calculated metric in the formula for another calculated metric. You can only use predefined metrics and custom metrics in the formula for a calculated metric." If you want margin per session and already have a margin metric, write the margin arithmetic out again inside the per-session formula. Each nested idea costs characters, which is where the 1,024-character ceiling starts to matter.

How do you create a calculated metric in GA4?
You create a calculated metric in Admin under Custom definitions, on the Calculated metrics tab, and you need the editor or administrator role on the property. Google's procedure runs in these steps.
- In Google Analytics, click Admin and confirm you are in the right account and property.
- Click Custom definitions, open the Calculated metrics tab and click Create calculated metric.
- Enter a Name. Google says it "must be unique across all other calculated and custom metrics," and you can change it later.
- Check the API name. GA4 fills it in from the Name field. You can edit it now, but Google says "you can't change the name once you create the calculated metric." It takes letters, numbers and underscores only.
- Write a Description. Google shows it in reports when someone hovers over the metric, so put the formula in plain words here.
- Enter the Formula, with each metric name in curly brackets.
- Pick a Unit of measurement.
- Click Save.
After saving, the edit menu lets you change the name, description, formula and unit, but not the API name. The same menu has a Copy option, which is the fastest way to build a second metric that differs by one input. Google adds that if you archive a calculated metric, its API name becomes free for a different calculated metric.
Treat the API name as permanent. Anything that queries the metric through the API uses that name, so a typo in step 4 stays in every script that reads it.
Which unit of measurement should a calculated metric use?
The unit of measurement decides how GA4 formats a calculated metric's value in reports, and the Admin API lists ten units: Standard, Currency, feet, miles, meters, kilometers, milliseconds, seconds, minutes and hours. Pick Standard for counts and for ratios of counts, Currency for money, and a time or distance unit only when every input is already in that unit.
Currency carries a second job. The Admin API labels each calculated metric with restricted metric types, either cost data or revenue data, which are "used in conjunction with user roles that restrict access to cost and/or revenue metrics." The field is output only, so you do not set it yourself. If your property restricts revenue or cost metrics by role, check how a new calculated metric is labelled before you share a report that shows it.
Google's help page gives two worked examples, and both use Currency.
| Name | Formula | Unit in Google's example |
|---|---|---|
| Shipping percentage | {Shipping amount} / {Purchase revenue} | Currency |
| Item discount percentage | {Item discount amount} / {Item revenue} | Currency |
Both divide one money amount by another, so read the result as a share, not as a sum of money.
Flowsery
Start Your 14-Day Free Trial
Real-time dashboard
Goal tracking
Cookie-free tracking
Where can you use GA4 calculated metrics?
GA4 calculated metrics are available in three places, according to Google: reports, explorations and the Google Analytics Data API. In reports, the name you chose appears in the metric selectors. Outside the GA4 interface, the Admin API says the API name is "used when referencing this calculated metric from external APIs," in the form calcMetric:{calculatedMetricId}.
Watch one API flag before you clean up custom metrics. The CalculatedMetric resource has an invalidMetricReference field, and Google warns: "Anything using a calculated metric with invalidMetricReference set to true may fail, produce warnings, or produce unexpected results." Before you archive a custom metric to free a slot, check every calculated metric formula for it.
Inputs also need time to fill. Google says a custom metric is ready for reports 24 to 48 hours after the parameter was sent and the custom metric was created. During the first 24 hours after you register a custom parameter, Google says its values can show as the placeholder explained in not set in GA4, so give a new input a full day or two before you judge a formula built on it.
Google's help page does not say whether a new calculated metric fills in dates before the day you created it. Save the metric, then open a past date range and compare the value against the same arithmetic done by hand.

Which calculated metrics are worth building first?
The calculated metrics worth building first are ratios that combine a revenue or cost figure with a traffic or key event count, because GA4 does not hold your business logic for those. Check the predefined metric list before you spend a slot. Google gives the same advice for custom metrics: "Don't create a custom event parameter if a predefined metric already exists." Engagement rate, for example, is already a predefined metric.
- Revenue per key event:
{Purchase revenue} / {Key events}. It shows what one of your key events is worth, which GA4's counts alone do not. - Margin:
{Purchase revenue} - {Cost of goods}, where Cost of goods is a custom metric you register from your own purchase parameter. - Discount share: Google's
{Item discount amount} / {Item revenue}example, for stores that run frequent promotions. Item discount amount comes from thediscountitem parameter, so your ecommerce tags have to send it.
Skip order value. The average order value formula is revenue divided by orders, and GA4 already ships a predefined Average purchase revenue metric. Session key event rate is predefined as well, so a sessions-based conversion rate does not need a slot either.
How does Flowsery report revenue ratios without a formula?
Flowsery shows revenue per visitor for each traffic source in its revenue tracking, after you connect Stripe, Paddle, Polar or Lemon Squeezy in one click. Its feature page says it lets you "Calculate the true value of each traffic source by revenue per visitor" and attributes revenue "to the campaigns, pages, and referrers that drove it." Flowsery's funnel analysis tracks the conversion rate between every funnel step and the revenue impact at each step, and goal tracking monitors completion rates over time. In Flowsery, revenue per visitor by source comes with the dashboard instead of a formula you write, name and keep inside a five-slot quota.
Frequently asked questions
How many calculated metrics can I create in GA4?
A standard GA4 property allows 5 calculated metrics. A Google Analytics 360 property allows 50. Admin shows how many you have created under Custom definitions, Quota information.
Can a GA4 calculated metric use another calculated metric?
No. Google states that you can't reference a calculated metric in the formula for another calculated metric. A formula takes only predefined metrics and custom metrics, so write the inner arithmetic out in full.
What operators can a GA4 calculated metric formula use?
A formula accepts minus or negative, plus, multiplication, division and parentheses. You can also enter numbers and decimals. Metric names go inside single curly brackets, and the whole formula stops at 1,024 characters.
Who can create a calculated metric in GA4?
You need the editor or administrator role on the property. Then open Admin, Custom definitions, the Calculated metrics tab, and click Create calculated metric.
Can I change a calculated metric after saving it?
You can edit the name, description, formula and unit of measurement. The API name is fixed once the metric is created. Google says archiving a calculated metric frees its API name for a different calculated metric.
Can I use GA4 calculated metrics in the Data API?
Yes. Google lists reports, explorations and the Google Analytics Data API as the places you can access calculated metrics. The Admin API says external APIs reference one as calcMetric: followed by its API name.
What is the difference between a calculated metric and a custom metric in GA4?
A custom metric is a field you register from an event parameter, so it holds values your tags send. A calculated metric collects nothing and only does arithmetic on predefined and custom metrics. They also have separate quotas: a standard property allows 50 custom metrics but only 5 calculated ones.
Flowsery
Start Your 14-Day Free Trial
Real-time dashboard
Goal tracking
Cookie-free tracking
Why is my GA4 calculated metric empty?
The most likely cause is a custom metric that has not filled in yet. Google says a custom metric is ready for reports 24 to 48 hours after the parameter was sent and the metric was created. Wait a full day or two, then check again.
Which unit should I pick for a GA4 calculated metric?
Pick Standard for counts and for ratios of counts, and Currency for money. Use a time or distance unit only when every input is already in that unit. The Admin API lists ten units in total.
How long can a GA4 calculated metric formula be?
A formula stops at 1,024 characters. It can reference at most 5 unique custom metrics, and any number in it has to fit in a 64-bit integer or floating point value. Because you cannot nest calculated metrics, writing the inner arithmetic out in full eats into that limit.
Was This Article Helpful?
Let us know what you think!
See us more often in Google
One click marks Flowsery as a preferred source, so our articles sit higher in your Top Stories, AI Mode, and AI Overviews.
Before you go...
Flowsery
Revenue-first analytics for your website
Track every visitor, source, and conversion in real time. Simple, powerful, and cookie-free.
Real-time dashboard
Goal tracking
Cookie-free tracking
Related Glossary Terms


How to Add Google Analytics Annotations in GA4 and Keep a Change Log
In GA4, Google Analytics annotations pin a dated note to line graphs. Who can add them, the 60 and 150 character limits, the 1,000 cap, and change log use.


What GA4 Custom Dimensions Do, and the Quotas That Cap Them
Registering GA4 custom dimensions turns your event parameters into report fields. See the three scopes, the 50, 25 and 10 quotas and the cardinality trap.


Why Your GA4 Bounce Rate Is Just Engagement Rate Flipped
Your GA4 bounce rate is the share of sessions that were not engaged. How Google defines it, how it differs from Universal Analytics, and where to add it.


What the GA4 Landing Page Report Counts and Where It Goes Blank
Google's GA4 landing page report lists the first page of every session. Where to find it, its default metrics, why (not set) rows appear and how to add source.


How GA4 Site Search Tracking Records What Visitors Type
Set up GA4 site search with enhanced measurement, add your own query parameters, find the Search term dimension and track searches without a URL.


Setting GA4 User Properties and Reporting on Them
Set GA4 user properties with gtag or Tag Manager, register them as user-scoped custom dimensions and stay inside the 25-property limit.
Related Articles


How to Link Search Console to GA4 and Publish Its Reports
Learn how to link Search Console to GA4 in Admin, which roles you need, how to publish the two reports in Library and what the data can't join.


Setting Up GA4 Content Grouping With One Parameter
Set up GA4 content grouping with the content_group parameter in gtag or Tag Manager, read the Content group dimension and keep (not set) rows out.


How the GA4 User ID Joins Signed-In Visits Across Devices
Sending a GA4 user ID links one signed-in person's sessions across devices. See the gtag setup, the 256-character rule, sign-out handling and the limits.

