How to Create a Custom Metric in Google Analytics 4

Cody Schneider8 min read

While Google Analytics 4 offers a trove of standard reports, they often only scratch the surface of what's really happening on your site. To measure the KPIs that are unique to your business, you need to go a step further. This guide will walk you through exactly how to create custom metrics in GA4, allowing you to track the specific interactions that define success for you.

GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

What Are Custom Metrics in GA4?

In Google Analytics 4, a custom metric is a user-defined measure for an event that isn't included by default. While GA4 automatically tracks basics like sessions, pageviews, and users, it doesn't know about the unique things you want to count or measure - like the value of a specific lead submission, the percentage of a video a user watched, or the number of premium features they used.

This is where custom metrics come in. They allow you to capture a numeric value from an event parameter and treat it as a metric in your reports. Think of it like this:

  • Standard Metric: Pageviews (GA4 counts this automatically).
  • Custom Metric: Time to complete a quiz (you have to tell GA4 to track this specific time value).

By creating custom metrics, you transform raw event data into meaningful business insights, enabling you to build reports that align with your specific goals, not just Google's default dashboards.

Custom Metrics vs. Custom Dimensions

It’s easy to mix up custom metrics and custom dimensions, but the distinction is simple and important:

  • Custom Dimensions: Describe the data. They are attributes, typically text-based. For example, blog_author, product_category, or a user's subscription_tier. They provide context to your numbers. You might see a "Pageview" metric segmented by a "Page Author" dimension.
  • Custom Metrics: Count or measure the data. They are always numbers. For example, scroll_depth_percentage, lead_value, or video_play_duration_seconds. They answer "how much?" or "how many?"

In short, dimensions provide the "what," "who," or "where," while metrics provide the "how much." For this guide, we're focused on capturing those numeric values that represent your business's unique KPIs.

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

Before You Start: Planning Your Custom Metric

A successful custom metric begins with a clear plan. A custom metric doesn't just appear out of nowhere, it has to be fed data from a numeric event parameter. This means the event, along with its specific parameter, must already be firing correctly. A little bit of prep work will save you a lot of headaches later.

1. Identify the Business Goal You Want to Measure

First, pinpoint what you’re trying to track. What question are you trying to answer? Get specific. Don't just say "track engagement." Instead, define what engagement means to you.

  • Good Example: "I want to measure how far down the page users scroll on our long-form blog posts to see which articles hold their attention."
  • Good Example: "I need to track the estimated dollar value of different types of demo requests from our pricing page."
  • Bad Example: "I want to see more stuff."

2. Define the Event and Its Parameter

Once you know what you want to measure, you need to figure out how GA4 will receive that measurement. This involves an event and a numeric parameter associated with it. The parameter is the vehicle that carries your metric's value into Google Analytics.

Let’s map our examples from the previous step:

  • Goal: Measure blog post scroll depth.
  • Goal: Track the value of demo requests.

The parameter name is crucial. The name you use in your web tracking (e.g., through Google Tag Manager) must exactly match the name you register later in the GA4 interface.

GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

Step-by-Step Guide to Creating a Custom Metric

This process takes place in two key stages. First, you need to tell your website to send the data (using Google Tag Manager). Second, you need to tell Google Analytics how to interpret that data.

Part 1: Sending the Numeric Value to GA4 with Google Tag Manager (GTM)

Google Tag Manager is the command center for sending custom data to GA4. If you don’t have an event already set up to send the numeric value you need, you’ll have to create one. For this example, let’s create a metric that measures the download count for specific PDF files.

Our plan: Send an event called file_download every time a PDF is clicked and include a parameter called download_count with a value of 1. This allows us to sum up the download_count metric in our reports.

  1. Create a Trigger in GTM: We need to tell GTM when to fire our event tag. Navigate to "Triggers" > "New".
  2. Create a Tag in GTM: Now we create the tag that sends the event data to GA4.
  3. Preview and Publish: Use GTM's Preview mode to test your changes. Click on a PDF link and look for your "GA4 Event - PDF Download" tag firing. In the GA4 DebugView, you should see the file_download event appear with the download_count parameter and its value of 1. Once confirmed, publish your GTM container.

Part 2: Registering the Custom Metric in the GA4 Interface

Now that GA4 is receiving your numeric event parameter, you need to officially "register" it as a custom metric so you can use it in your reports.

  1. In your GA4 property, navigate to the Admin section (the gear icon in the bottom-left).
  2. Under the "Data display" column, click on Custom definitions.
  3. Click the Custom metrics tab at the top. You’ll see a list of any custom metrics that already exist. Click the blue Create custom metric button.
  4. Now, fill out the configuration form:
  • Metric Name: This is the friendly, readable name that will appear in your reports. Let’s use "PDF Downloads".
  • Scope: Leave this set to Event. All custom metrics are event-scoped.
  • Description: Add a brief note for your team so everyone knows what this metric is for (e.g., "Counts the number of PDF file downloads").
  • Event Parameter: This is the most crucial step. The name must be an exact match of the parameter you configured in GTM. In our case, that is download_count. Don’t use your user-friendly metric name here.
  • Unit of measurement: Choose the unit that makes sense. Since we're counting downloads, Standard is perfect. If you were tracking a lead value, you’d choose "Currency." For distance or time, there are other relevant options.
  1. Click Save. You're all done!

Keep in mind that it can take up to 48 hours for data to start populating in your reports for a newly created custom metric. Don't panic if you don't see it immediately.

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

Using Your New Custom Metric in Reports and Explorations

Once your metric is collecting data, you can finally put it to use. The primary place you'll use custom metrics is in GA4's Explore section, where you can build fully custom reports.

Let’s build a simple report to see which pages are driving the most PDF downloads.

  1. Navigate to the Explore tab in GA4 and start a new Free form exploration.
  2. In the "Variables" column on the left, click the (+) icon next to "Dimensions." Search for and import "Page path and screen class."
  3. Now click the (+) icon next to "Metrics." Search for the friendly name you gave your metric, "PDF Downloads," and import it.
  4. Drag the "Page path and screen class" dimension over to the "Rows" configuration box.
  5. Drag your "PDF Downloads" metric over to the "Values" configuration box.

Instantly, the table on the right will update, showing you a list of every page path alongside the number of PDF downloads that occurred on each, giving you immediate insight into which content is most effective at driving this key conversion.

Common Issues and Troubleshooting

Things don't always go right on the first try. Here are a few common problems and how to solve them.

Problem: My custom metric shows 0 or isn't appearing at all.

  • Cause 1: Typos. The single most common issue is a mismatch between the event parameter name in GTM (download_count) and the name you entered in the GA4 custom definition. Double-check them for spelling, capitalization, and spacing. They must match perfectly.
  • Cause 2: Time Lag. Have you waited 24-48 hours? GA4 is not always real-time with new configurations. Patience is key.
  • Cause 3: Incorrect Value Type. A custom metric parameter must receive a number. If GTM is accidentally sending a text value (e.g., sending "one" instead of 1), GA4 won't be able to process it as a metric. Verify the value in GTM Preview mode.

Problem: I've hit a limit on custom metrics.

  • Cause: The free version of Google Analytics 4 has limits. You can create up to 50 event-scoped custom dimensions and 50 event-scoped custom metrics.
  • Solution: Plan your instrumentation carefully. Before creating a new custom metric, ask yourself if it represents a core business KPI. Audit and delete old, unused custom definitions to free up space. Focusing only on what truly matters prevents you from hitting this ceiling.

Final Thoughts

Creating custom metrics in Google Analytics 4 is how you translate generic website activity into specific business performance. By defining and tracking what really matters, you can surface powerful insights that standard reports miss, tying your optimizations directly to your bottom line.

Setting this all up manually is a huge step up, but it often involves hopping between different platforms and wrangling reports. At Graphed, we centralize this process by connecting directly to your marketing and sales tools, including GA4. You can analyze all your data - standard and custom - in one place by asking simple questions in plain English, turning hours of report-building into seconds, and letting you focus on the insights, not the setup.

Related Articles