Metrics
A metric is a measuring stick — in everyday language, the number you watch to decide if a change helped (more signups, fewer errors, higher revenue). In CROForge, a metric is a reusable success definition stored in Data Vista: which event counts, optional conditions on that event’s properties, how to calculate the number, and whether a higher or lower result is good. You create the metric here, then attach it to one or more experiments. Metrics do not run by themselves; they score events that fire on the site.
Words used on this page
| Word | Everyday meaning | Meaning in CROForge |
|---|---|---|
| Metric | A measuring stick for success. | Event + optional conditions + calculation type + direction. Created under Data Vista → Metrics, then linked on the experiment Metrics tab. |
| Event | Something that happened. | The catalog item the metric listens to (standard click, page view, or a custom purchase event). Chosen by event id when you build the metric. |
| Event property vs Attribute | A property is a field on one happening. An attribute is a trait of a person. | Event properties live on the event payload (click text, amount, target URL) and feed metric conditions and “value of event property” calculations. Attributes describe the visitor and feed segments, not metric math. |
| Conversion | The desired outcome (a sale, a signup, a demo request). | What the metric is designed to count or score so the campaign report can compare variations. |
| Calculation types | How you turn raw happenings into one number. | METRIC_CALCULATION_TYPE: Unique visitor (0), Unique session (1), Event count (2), Value of event property (3). |
| Aggregation | Combining many numbers into one (sum, average, first, last). | METRIC_PROPERTY_VALUE_TYPE when calculation is Value of event property: First (0), Last (1), Sum (2), Avg (3), Min (4), Max (5). |
| Direction Up/Down | Whether “more” or “less” is the win. | METRIC_DIRECTION: Up (0) means higher is better; Down (1) means lower is better (bounce, errors, time-to-complete when less is good). |
| Standard vs Custom | Shipped vs workspace-made. | Same split as attributes and segments. Custom metrics are the ones you typically attach to campaigns. |
| Condition AND logic | Every rule must pass together. | Every metric condition must pass for that event before it contributes to the metric. |
| PAGE_URL | The address of the page. | Can appear as a URL-typed event property with include/exclude packs, so only events on the right pages count. |
| Data Vista | The data library / view. | Home of metric definitions. Experiments only link to metrics created here. |
| Impression | Being shown something (an ad impression, a variation shown). | A separate runtime event that a visitor was assigned or shown a variation. Metrics usually listen to clicks, page views, or custom conversions — not to impression itself — but matching metrics still receive live experiment context. |
Screenshot filename: metrics-list.png. Paste this page into the WordPress Code editor, then insert that screenshot from the Media library. Do not use a Markdown image tag.
What a metric defines
Every metric answers four questions:
- Which event counts (for example a standard click, or a custom purchase event).
- Optional conditions on event properties (button text is “Book Demo,” amount between 100 and 200, page URL include/exclude).
- How to calculate (unique visitors, unique sessions, event count, or an aggregated property value).
- Direction — Up means higher is better; Down means lower is better.
Create the metric under Data Vista → Metrics, then attach it on the experiment. One clear primary metric avoids conflicting “winners.” Secondary metrics (if you attach more than one) should explain the story, not compete with the primary.
Categories
Standard vs Custom — the same pattern as attributes and segments. The left sidebar lists both groups; the right panel shows details. Create and edit use a modal (name, description, event, metric type, direction, conditions). Delete asks for confirmation. Standard metrics may ship with the product; custom metrics belong to the workspace.
Calculation types
Stored as METRIC_CALCULATION_TYPE. Product copy often shows the enum name with underscores replaced by spaces (for example UNIQUE VISITOR).
| Name | Value | Everyday meaning | Meaning in CROForge |
|---|---|---|---|
| Unique visitor | 0 | Count each person once, even if they click ten times. | For each visitor, count only one matching event. Best for “did this person convert?” |
| Unique session | 1 | Count each visit once. | For each session, count only one matching event. |
| Event count | 2 | Count every time it happened. | Count every matching occurrence. A visitor who clicks three times contributes three. |
| Value of event property | 3 | Add up (or average) a number on the event, such as revenue. | Aggregate a numeric event property using First / Last / Sum / Avg / Min / Max. Requires an event property id and a property value type. |
Property aggregation
Used only when calculation = Value of event property (METRIC_PROPERTY_VALUE_TYPE):
| Name | Value | Everyday meaning |
|---|---|---|
| First | 0 | From each visitor, use only the first occurrence of the property. |
| Last | 1 | From each visitor, use only the last occurrence. |
| Sum | 2 | Add every matching value (typical for revenue). |
| Avg | 3 | Average of matching values. |
| Min | 4 | Smallest matching value. |
| Max | 5 | Largest matching value. |
Direction
| Name | Value | When to use it |
|---|---|---|
| Up | 0 | Default. Clicks, purchases, signups — more is better. |
| Down | 1 | Bounce, errors, or any measure where less is the win. |
Conditions on metrics
Without conditions, every firing of the chosen event counts. Conditions narrow that to the conversion you actually care about. Each condition picks an event property, a match type, and a value. All conditions must pass (AND).
Examples:
- Click text exact
["Book Demo"]— only that CTA, not every click on the page. - Target URL exact match for the contact page.
- Amount between
100and200. PAGE_URLinclude/exclude pack so the same event on other pages is ignored.
Match types follow the property’s data type (text, number, boolean, URL). URL properties use include/exclude rule packs, the same idea as experiment page targeting.
Linking to experiments
- Ensure the metric exists under Data Vista → Metrics.
- Open the experiment → Metrics.
- Add / link metrics (primary plus secondary if you use more than one).
- Save.
Align the metric’s event with the change you are testing: a CTA test should measure clicks on that CTA, not every page view.
What happens at runtime
When an event is sent, Smart Code finds matching metrics and attaches [experimentId, variationId] pairs for live experiments. Matching typically requires:
- The metric’s event
apiNameequals the fired event name (case-normalized as implemented). - Every metric condition passes.
- The metric is linked to an experiment that currently has a live variation id.
That context is what lets reports credit the correct variation. Details live in the event pipeline documentation.