Creating your first metric
In order to create a metric, you must have a data warehouse connected and an entity created. See the initial setup quickstart for details.
Metrics are standardized definitions of where data lives in your data warehouse and how it should be used to analyze experiments. In this guide, you'll create a Fact SQL definition to tell Eppo where data lives, and create a metric definition to standardize how this data should be used to analyze experiments.
1. Create a Fact SQL definition
Fact SQLs define events, like sign-ups, activations, or orders. Together, Assignment and Fact SQLs give a picture of what happened to different segments of users shown different variants of the experiment.
Follow the steps below to create your first Fact SQL definition.
- Navigate to the Definitions page, click +Create Definition SQL, then click Fact SQL
- Name your Fact SQL
- Write SQL to return event data from within your data warehouse. At a minimum, the SQL should return a unique identifier (e.g.,
user_id
) and a timestamp. You can optionally include numeric values (e.g., purchase price) and fact properties to later slice results (e.g., device type). - Specify the timestamp and entity id columns
- Create Facts for any columns from which you plan to build metrics, or select "Each Record"
- Click Save and close
2. Create a Metric
Metrics specify how the raw event data you defined above should be aggregated for experiment analysis. Follow the steps below to create your first metric.
- Navigate to the Metrics page and click +Create
- Select the relevant entity
- Select the fact you would like to aggregate and the relevant aggregation method
- (Optional) Set metric time window (relative to experiment assignment), and Winsorization settings
- Hit Create Metric and repeat for any other metrics you would like to create
You have now created your first metric! Next, check out our quick start on running your first experiment or analyzing a past experiment.