Expand my Community achievements bar.

Taking Your Metrics Up a Level: Using Advanced Function in Your Calculated Metrics

Avatar

Community Advisor and Adobe Champion

12/2/24

Have you wished you had a guide for how to use advanced functions in your calculated metrics? Check out the link at the bottom of this post to see a new guide that I’ve written to help you understand the various functions available.

 

Calculated metrics are one of the most powerful features available in Adobe Analytics. Creating your own metrics gives you the flexibility to define KPIs like conversion rate or add-to-cart rate rather than simply relying on the events captured on your website (or Adobe’s out-of-the-box metrics). There are several features in calculated metrics that you can use: adding segments, containers, static numbers, and of course, functions.

 

Each function performs some type of mathematical computation in order to give you options for how you want to build your metrics. Some of these functions, like mean or median, are pretty basic yet still very powerful. You can use them to get an average of a particular metric without worrying about dividing it yourself. If you want to get an average number of visitors per day for changing time periods, a week, a month, or even a year, the mean will adjust without any work from you to make multiple metrics for each time frame. Your result will depend on what dimension you’re using in the rows of your table, but switching out a dimension is much easier than having to build multiple metrics.

MandyGeorge_0-1733195848483.png

MandyGeorge_1-1733195860494.png

 

One of the other great features of the advanced functions, and the metric builder in general, is the ability to nest functions inside of each other. Say you want to be able to filter out certain rows based on a metric. Technically this isn’t possible, but it doesn’t mean you can’t do something quite similar with nested functions. If you want to see your top converting products, just sorting by conversion rate is going to give you a lot of low-traffic products that end up with very high conversions. You can filter these out by using two functions: ‘if’ and ‘greater than.’ Start with your if function, and nest the greater than function in the logical test. Now your logical test is comparing two values. Bring in your visit metric for one and use a static number for the other. What you use for the static number will vary depending on your site’s traffic. Let’s say we set it at 100. It’s now going to compare visits for the product to 100. We then have the rest of the if function – the value if true and the value if false. If it’s true that product visits are over 100, we can return the conversion rate for the product. If visits are less than 100, so our test is false, we return a static number of 0. Now when we put this in our table, it’s going to give us the conversion rate for products, but only if they have sufficient traffic to be relevant, essentially filtering out all low-traffic items. While they are still in the table, those products are now at the bottom, giving you a clean visualization.

MandyGeorge_2-1733195936828.png

 

If you want to get really fancy, you can get into some advanced calculations with these functions. Say you need to compare two metrics, but they’re very different, like visits and orders. You can use the natural log function or the log base 10 function. Both of these work to normalize your values, making it easier to compare between different metrics.

MandyGeorge_3-1733195982298.png

 

There are so many different ways that you can use the functions. Cumulative average lets you see a changing average over time. Count distinct gives you the distinct number of items in a dimension. Regressions let you determine missing data based on relationships between variables. The floor and ceiling functions let you round numbers down or up every time. The z-test and t-test let you calculate statistical significance. I could go on forever about how useful these functions are. And to be fair, I kind of did.

 

If you want to know how to use any of these functions in detail, you can check out my newly published guide. In it, I have situations for nearly every function available in the metric builder. They have descriptions, instructions on how to build them, and examples of when to use them. This guide isn’t meant to be read from start to finish; it’s meant to be kept on hand and used as needed when you’re trying to build out a metric and are using the different functions. I hope that you have as much fun using this guide and building metrics as I did while writing this!

 

Download the guide here:

https://experienceleague.adobe.com/en/perspectives/calculated-metrics-playbook-your-one-stop-shop-fo...