We’re improving the metric creation experience. Our recent redesign lets you preview changes while you create and edit custom metrics. We’ve also combined raw and modelled data sources into a single object called a data feed.
If you see Data Feeds in the left navigation sidebar, go to this article.
These new features are being released gradually. If you don't see them in your account yet - no worries - they’re coming soon!
Sometimes you might not be sure which configuration options to choose when creating custom metrics. This article walks you through some configuration examples using a question/answer technique that you can apply every time you build custom metrics.
This article includes the following examples:
Displays the current total of followers from a pre-aggregated (totaled) value that is refreshed on a regular basis.
Displays the number of sessions. The source data contains daily totals that reset to zero at the beginning of each day and accumulate throughout each day.
Each new transaction is recorded as a unique entry and is added to the previous values to display the total current sales revenue.
These examples demonstrate how one data source can be used to create more than one metric depending on what is being measured.
Note: The metric examples in this article were chosen because they’re well-known and understood. However, when it comes to adding metrics to your account, we recommend checking first to see if the metric you’re looking for is available as an instant metric (instead of creating a custom version). For example, PowerMetrics includes Followers as an instant metric for Instagram Business and Sessions as an instant metric for HubSpot. Learn more about instant metrics and the services that include them.
Example 1 - Follower Count custom metric
In this example, we create a Follower Count custom metric. Our final metric looks like this:
The data source we used to create our custom metric looks like this. Note how the data changed after being refreshed with new data:
Previous data - Before refresh |
New data - After refresh |
To help us understand which options to choose for this custom metric, we asked (and answered) the following questions:
- Question: What is the one thing we want to measure for this metric? Remember, a metric measures a single value.
Answer: In this case, we’ll choose the Follower Count column as our metric value (and Sum as our default aggregation type). Follower Count is the number of users who follow your social media posts, for example, via LinkedIn, Facebook, or Instagram.
- Question: When were the values recorded? Depending on the value you want to measure, this may be a date column in the data source or it may be the current date (the time when the records were fetched, also known as “import time”).
Answer: For this metric, we’re interested in the most up-to-date results. Each time our data is refreshed, we get the latest values. So, we’ll choose Use the current date as our Date & time option.
- Question: Do new values add to or replace previous values?
Answer: In this case, new values replace previous values, so we’ll choose Current values as our Data shape.
Metrics that are similar to Follower Count
Some metrics that use the same type of custom metric configuration as Follower Count are: Page Likes, Subscribers, Page Reach, and Content Engagement.
Example 2 - Sessions custom metric
In this example, we create a Sessions custom metric. Our final metric looks like this:
The Sessions metric measures the number of sessions per day (a daily count that resets every day). If you refer to the metric above, you’ll notice that the previous day of data is replaced with new data on the following day throughout the time period. Note: The following screenshot of the data source we used to create our custom metric shows the last two days of data only, whereas the metric example above shows one month of data.
To help us understand which options to choose for this custom metric, we asked (and answered) the following questions:
- Question: What is the one thing we want to measure for this metric? Remember, a metric measures a single value.
Answer: In this case, we’ll choose the Sessions column as our metric value (and Sum as our default aggregation type). The Sessions metric is used to track the number of times a user interacts with your website.
- Question: When were the values recorded? Depending on the value you want to measure, this may be a date column in the data source or it may be the current date (the time when the records were fetched, also known as “import time”).
Answer: For this metric, we’re interested in the column from the data source where a record was added each time a session occurred. So, we’ll choose the relevant time column as our Date & time option.
- Question: Do new values add to or replace previous values?
Answer: In this case, new values replace previous values (the new values represent the current total for each day) so we’ll choose Periodic summary as our Data shape.
Metrics that are similar to Sessions
The Website Visits metric uses the same type of custom metric configuration as Sessions.
Example 3 - Sales Revenue custom metric
In this example, we create a Sales Revenue custom metric. We track sales transactions throughout the day and display the results in our metric as a sum of transactions for a time period (in our example, every hour).
A record is added to the date column in our data source for each single transaction, by date and time (day/mth/yr and hr:min:sec). Each new transaction adds to the previous value. The final data point that displays in the metric at any given time throughout the day displays a sum of all of the transactions that have occurred since the previous hour.
The following table displays our data source, which includes transactions for Feb 17, 2022 from 08:05:25 to 09:17:03. It also displays the related metric, with summed data at 8:00 (the total of all transactions that occurred from 8:05:25 - 8:44:01) and summed data at 9:00 (the total of the transactions so far for the period from 9:01:30 - 9:17:03):
Data Source - Before refresh |
Metric - Before refresh |
The following table displays the same data source as above after it was refreshed with new data (a little later in the morning, at 9:52:30). Note that the summed result at 9:00 in the metric has increased, to include the additional transactions.
Data Source - After refresh (new data added) |
Metric - After refresh (new data added) |
To help us understand which options to choose for this custom metric, we asked (and answered) the following questions:
- Question: What is the one thing we want to measure for this metric? Remember, a metric measures a single value.
Answer: In this case, we’ll choose the Sales column as our metric value (and Sum as our default aggregation type).
- Question: When were the values recorded? Depending on the value you want to measure, this may be a date column in the data source or it may be the current date (the time when the records were fetched, also known as “import time”).
Answer: For this metric, we’re interested in the column from the data source where a record was added each time a sale occurred. So, we’ll choose the relevant time column as our Date & time option.
- Question: Do new values add to or replace previous values?
Answer: In this case, new values add to previous values. We’re interested in the “total” revenue where each individual sale adds to the previous value. As a result, we’ll choose Transactional values as our Data shape. Note: “New” values are values that weren’t in the previous ingestion. Each value is only counted once.
Metrics that are similar to Sales Revenue
Some metrics that use the same type of custom metric configuration as Sales Revenue are: Income, Revenue, and Gross Sales.
Examples 4 and 5 - Total Customers and New Customers custom metrics
The following two examples illustrate how you can use a single data source to create two different metrics.
The data source we used to create these two custom metrics looks like this (note that only a portion of the total rows is displayed here):
Total Customers
In this example, we create a Total Customers custom metric that shows the current total number of customers we have at any time. Our metric looks like this:
To help us understand which options to choose for this custom metric, we asked (and answered) the following questions:
- Question: What is the one thing we want to measure for this metric? Remember, a metric measures a single value.
Answer: In this case, we’ll choose the Count of Customer Name column as our metric value (and Count rows as our default aggregation type). The Total Customers metric tracks our current total number of customers. To get this data we’ll count the number of rows in the customer name column from the data source table.
- Question: When were the values recorded? Depending on the value you want to measure, this may be a date column in the data source or it may be the current date (the time when the records were fetched, also known as “import time”).
Answer: For this metric, we’re interested in the most up-to-date results. Each time our data is refreshed, we get the latest values (the current list of customers). So, even though there’s a time column in the data source, we’ll choose Use the current date as our Date & time option instead.
- Question: Do new values add to or replace previous values?
Answer: In this case, new values replace previous values. We’re interested in the latest list of customers. The most recent customer list replaces the previous customer list. We’ll choose Current values as our Data shape.
New Customers
In this example, we create a New Customers custom metric that shows the count of new customers that are added for each week. Our metric looks like this:
To help us understand which options to choose for this custom metric, we asked (and answered) the following questions:
- Question: What is the one thing we want to measure for this metric? Remember, a metric measures a single value.
Answer: In this case, we’ll choose the Count of Customer Name column as our metric value (and Count rows as our default aggregation type). The New Customers metric tracks new customer acquisitions. To get this data we’ll count the number of rows in the customer name column from the data source table - just like we did in the Total Customers metric example above. However, we’ll choose a different Date & time option and a different Data shape.
- Question: When were the values recorded? Depending on the value you want to measure, this may be a date column in the data source or it may be the current date (the time when the records were fetched, also known as “import time”).
Answer: For this metric, we’re interested in the column from the data source where a record was added each time a customer was acquired. So, we’ll choose the relevant time column (the Acquisition Date column) as our Date & time option instead.
- Question: Do new values add to or replace previous values?
Answer: In this case, new values add to previous values. The number of customers grows each time a new customer is acquired, so each acquisition adds to the previous value of new customers. As a result, we’ll choose Transactional values as our Data shape.