- Confidence Cloud, the default for every new account: choose an entity, send an event, and Confidence generates the fact table for you.
- Warehouse Native: create an entity, an assignment table, and a fact table in your own data warehouse with SQL.
Before You Begin
- You need a Confidence account.
- To do steps with AI, connect the Confidence MCP servers or use the Confidence Agent. See Set up Confidence for your AI assistant.
Set Up the Data
- Confidence Cloud
- Warehouse Native
On Confidence Cloud you don’t write SQL tables. You send events, and Confidence
generates a fact table for each event that references an entity. See
Metrics without SQL.
Choose an Entity
An entity represents what you measure, such as a user, an account, or a device. Every account comes with two built-in entities:User and Visitor. This guide uses User.To measure another kind of unit, create an entity
in the app or with the API. The MCP servers can’t create entities, but
listEntities shows the ones you have.Define the Event
An event is a record of something that happens in your product, such as a purchase. For this guide, define apurchase event with these fields:user_id: a string that references theUserentityamount: a number, which becomes a measurementproduct: a string, which becomes a dimension
- To define the event in advance, select Events in the sidebar and click
Create. In the Create event dialog, enter
purchaseand add the fields. Setuser_idto type String with semantic type Entity. - To create the event from events you already send, find
purchasein the Events table. It shows as Sent but not stored. In its row, click the outlined Create, review the schema, setuser_idto semantic type Entity, and click Create.
createEventDefinition tool. For example:Send Events
Send the event from your application with a Confidence SDK or the events API. To check that events arrive, ask your AI assistant to query event usage. It uses thequeryEventsUsage tool.Use the Generated Fact Table
Confidence creates a fact table for the event as soon as the event exists:- Numeric fields, such as
amount, become measurements. - Other fields, such as
product, become dimensions. - The event timestamp becomes the timestamp column.
purchase. It appears in the regular list of fact tables. To find it, select
Admin > Data Tables > Fact tables in the app, or ask your AI assistant to
list fact tables (listFactTables).Create a Metric
The final step is the same on Confidence Cloud and Warehouse Native: create a metric that aggregates the fact data. A metric can be any aggregation of the fact data, such as a sum, an average, or a count. All metrics aggregate measurements over some time window. Watch the following video for a 4-minute overview of the different ways to handle time in metrics.
For this tutorial, create a metric that computes the average weekly sales
amount per user.
With AI
The Flags MCP server can create the metric with thecreateMetric tool. The
in-app Confidence Agent can’t create metrics. Create them in the app or with
the Flags MCP server. For example:
createMetricCalculation and queryMetricCalculation.
In the App
To create a metric, follow these steps:1
Go to Confidence
2
Navigate to Metrics
On the left sidebar, select Metrics.
3
Click + Create
4
Enter metric details
Enter
Average weekly sales per user as the name of the metric and assign yourself as the owner. Skip the description for now.5
Select Consumption as the metric type
6
Select the consumption value
Select the
User entity, the fact table that holds your sales data, and the amount measurement as the Consumption value.7
Add attribute criteria
Click Add Attribute criteria and select
product as the attribute. Set the filter to product is podcast.8
Configure when to include users
In the When to Include Users In Metrics Results step, select
Cumulatively during a window and 1 week starting at exposure.9
Click Next to skip the Suggested usage
10
Review and create
Review your metric setup, and then click Create.
Related Resources
Launch an A/B Test
Use your metric to measure experiment results
Launch a Rollout
Use your metric to monitor a gradual release
Metrics Reference
Deep dive into metric types and configuration
Validate Metrics
Learn how to verify your metrics are working correctly

