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 you're in the right place. If not, go to this article instead.
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 feed 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 feed 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 measure (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 feed or it may be the current date (the time when the records were fetched, also known as the “refresh 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. We'll deselect the Data feed contains historical data toggle to get results for most recently refreshed data.
- Question: Do new values add to or replace previous values?
Answer: In this case, new values replace previous values, so we’ll choose Use most recent values only and select as of right now as the time period for the date handling step.
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 feed 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 measure (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 feed or it may be the current date (the time when the records were fetched, also known as “refresh time”).
Answer: For this metric, we’re interested in the column from the data feed where a record was added each time a session occurred. So, we’ll select the Data feed contains historical data toggle and the relevant date column from the data feed.
- 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 Use most recent values only and select for each day, week, month, or year as the time period for the date handling step.
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 feed 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 feed, 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 Feed - Before refresh |
Metric - Before refresh |
The following table displays the same data feed 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 Feed - 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 measure (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 feed or it may be the current date (the time when the records were fetched, also known as “refresh time”).
Answer: For this metric, we’re interested in the column from the data feed where a record was added each time a sale occurred. So, we’ll select the Data feed contains historical data toggle and the relevant date column from the data feed.
- 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 Use all values for the date handling step. 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 feed to create two different metrics.
The data feed 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 measure (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 feed table.
- Question: When were the values recorded? Depending on the value you want to measure, this may be a date column in the data feed or it may be the current date (the time when the records were fetched, also known as “refresh time”).
Answer: For this metric, we’re interested in the most up-to-date results. We’ll deselect the Data feed contains historical data toggle. This way, at each refresh, we'll get the latest values (the current list of customers).
- 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 Use most recent values only and select as of right now as the time period for the date handling step.
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 measure (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 feed table - just like we did in the Total Customers metric example above. However, we’ll choose a different Date and time option and a different Data structure.
- Question: When were the values recorded? Depending on the value you want to measure, this may be a date column in the data feed or it may be the current date (the time when the records were fetched, also known as “refresh time”).
Answer: For this metric, we’re interested in the column from the data feed where a record was added each time a customer was acquired. So, we’ll select the Data feed contains historical data toggle and the relevant date column (the Acquisition Date column) from the data feed.
- 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 Use all values for the date handling step.