Reusable metrics in Optimizely Analytics are computed properties that you can define once and reference across any Optimizely Analytics exploration, dashboard, or experiment. Instead of rebuilding calculations from scratch every time, you can create a standardized metric that includes complex logic, such as:
- Joins with other datasets to enrich your analysis.
- Filters to home in on specific user segments or behaviors.
- Aggregations to sum, average, or count key values.
With metric presets, you can also pre-configure how a metric displays and behaves wherever it is used. This eliminates the need to reapply the same settings in multiple places, ensuring consistency.
Use Blocks to customize metrics if the existing templates do not match your requirements. There is also a subset of five metric templates that you can use to get started, and they are as follows:
You can use a metric anywhere in the app where the Catalog is accessible. The configuration for a metric is saved within Analytics and is accessible through the Catalog. You can use it like any other column in the catalog.
A metric has the following configuration:
- Name – Ensure the metric's name is unique across columns (including metrics and cohorts) within that dataset.
- Default aggregation – Choose an aggregation type, such as count or sum, that is used by default when the metric serves as a measure.
Metrics are not tied to a specific dataset. This is a key difference between metrics and derived columns.
Create reusable metric definitions
Within the Definition tab in Metrics, you can add the basic information and definition for your metric.
- Click Add (+) > Metric.
- Choose from templates like Simple Aggregation, And/Or, and Filter, or create Custom metrics using blocks. This choice helps you get started, but you can change it later if needed. Use blocks to define the computation for your metric in the block editor.
- Enter a name and description.
- Click Run to sample the computed values. The resulting table displays the metric values, along with any associated dimensions.
- Click Save.
You can now use the metric as a catalog entity anywhere the catalog is accessible, like inside exploration templates or the block editor.
Types of reusable metric templates
Simple aggregation
This template lets you calculate a simple aggregated metric. For example, to create a metric for total subscription revenue, which is the total revenue generated by Flix's monthly subscriptions,
- Go to + > Metrics > Simple Aggregation.
- Click Unnamed Metric, and enter a name and description.
- Choose sum as the aggregator and set price from the subscriptions dataset as the value in the Aggregate block.
- Click Run. Use the drop-down list in the visualization window to select a different chart type.
- Click Save.
Filter
This metric template lets you apply a filter to any input. For example, to create a metric for users whose total time viewed on the platform exceeds 100,000 minutes,
- Go to + > Metrics > Filter.
- Click Unnamed Metric, and enter a name and description.
- Select All Users as the value in the filter block.
- Choose Total Time Viewed (TTV), and set the condition to "> 100,000."
- Click Run.
- Click Save.
And/Or
This metric template lets you use nested and/or statements to produce a true or false value. For example, to create a metric for purchases made and total time viewed in the last 30 days,
- Go to + > Metrics > And/Or.
- Click Unnamed Metric, and enter a name and description.
- Choose the Purchased in Last 30 Days cohort in the and/or block, and set the value to True.
- Click + to add another condition. Choose the TTV Last 30 Days derived column and set the value to 500.
- Click Run.
- Click Save.
Custom
This template lets you calculate a cohort of values by composing multiple blocks. For example, you can create a metric to determine the average total time viewers spend viewing content on the platform:
- Go to + > Metrics > Custom.
- Click Unnamed Metric, and enter a name and description.
- Click + Add Block > Formula.
-
Enter the following formula in the formula block to calculate the incremental duration:
Data.Content.duration * Data."Product Events"."Incremental Completion Fraction" - Add an Aggregate block and name it Aggregate 1. Set the aggregator to sum, and choose the Incremental Duration block as the value. Add a filter for the event type Play Content and group the results by Users.
- Add another aggregate block, naming it Aggregate 2. Set the aggregator to avg and choose Aggregate 1 as the value.
- Click Run.
- Click Save.
Formula
This template lets you write a custom formula using algebraic operations and functions like round, substring, and so on. For example, you can create a metric for total revenue, which includes revenue from pay-per-view (PPV) purchases, advertisements, and monthly subscriptions:
- Go to + > Metrics > Formula.
- Click Unnamed Metric, and enter a name and description.
-
Input your custom NetScript logic to calculate total revenue in the metric block:
Metrics."Total Ad Revenue" + Metrics."Total Subscription Revenue" + Metrics."Total Purchase Revenue" - Click Run.
- Click Save.
Create metric presets
Within the Presets tab in Metrics, you can define universal display and behavior rules for your metric, eliminating the need for manual configuration in every report. You can configure the following presets:
- Formatting – This field lets you set the format for displaying the metric values. It includes multiple formats, including decimal, percentage, dates, and times. This is the only preset that applies to both experimentation and non-experimentation metrics. All other presets are applicable only to experimentation metrics.
- Direction – This field sets the expected direction of change for the metric. It indicates whether an increase in the metric value is considered a positive or negative change. This preset applies only to experimentation metrics.
- Conversion window – This field specifies the time frame within which conversions are counted after an event. It defines how long after an event a conversion can be attributed to it. This preset applies only to experimentation metrics.
- CUPED duration time interval – This field defines the time interval for which CUPED is applied. This preset applies only to experimentation metrics.
- Set alerts – This field lets you set alerts based on threshold breaches. It lets you specify a threshold percentage at which an alert is triggered if the metric's value crosses it. This preset applies only to experimentation metrics.
Use these steps to configure alerts:
- Set the threshold in the Alert when threshold is breached field.
- Add a visitor count in the Alert only if users amount is more than field.
- Choose a list of users in the Notify field.
- Check the Alert only when statistical significance is reached option so that alerts are only triggered if the indicated threshold was breached by a variation that reached statistical significance, reducing noise from early or incomplete data.
- Outlier management – This field provides options for handling outliers in the metric data. It includes settings for the method used to manage outliers and the bounds for outlier detection. This preset applies only to experimentation metrics.
View reusable metrics
- Click the Home icon.
- Select the Metrics checkbox.
- Use the search bar to find individual metrics by name.
You can find a paginated listing of metrics in the app. Each metric entry contains the following information:
- Name (with description, if any)
- Created by
- Updated by
- Updated at
- Type (refers to the template used when defining the metric)
Edit reusable metrics
- Click Home.
- Select the Metrics checkbox.
- Identify the metric you want to edit and click the Name.
Delete reusable metrics
- Click Home.
- Select the Metrics checkbox.
- Identify the metric you want to delete and click More (⋮) > Delete.
- Click Yes to confirm.
Please sign in to leave a comment.