Skip to content

Goals

Goals define what success means for an experiment. They turn exposures into measurable conversion rates.

A goal is a conversion criterion attached to an experiment. When a visitor with an active assignment meets the goal condition, Ttoolab records a conversion for that visitor’s variant.

Each experiment can have multiple goals. One goal is typically marked as the primary goal for reporting.

| Type | Trigger | | :--- | :------ | | page_view | Visitor reaches a URL matching a pattern | | click | Visitor clicks a CSS selector | | custom_event | Visitor triggers a ttoolab.track() event with a matching name | | revenue | Custom event includes a revenue value in the payload | | form_submit | Visitor submits a form matching a selector |

Conversion rate = conversions / exposures
  • Exposures are counted automatically when a visitor is assigned ($exposure event).
  • Conversions are counted when a goal condition is met after assignment.

Results are broken down per variant in the dashboard.

The most flexible approach is a custom_event goal:

  1. Create a goal with event name purchase.
  2. Send the event from your checkout code:
window.ttoolab?.track("purchase", {
revenue: 99.90,
currency: "USD"
});
  1. Ttoolab attributes the conversion to the visitor’s assigned variant.

| Goal | Type | Configuration | | :--- | :--- | :------------ | | Order completed | custom_event | Event name: purchase | | Cart add | custom_event | Event name: add_to_cart | | Revenue per order | revenue | Event name: purchase (with revenue in payload) | | Thank-you page | page_view | URL contains /order-confirmation | | Checkout CTA click | click | Selector: #checkout-button |

Include a numeric revenue field in the event payload:

window.ttoolab?.track("purchase", {
revenue: 249.00,
order_id: "ORD-12345"
});

Revenue is aggregated per variant in daily stats.

Set a primary goal when creating the experiment. The dashboard highlights this goal in results summaries and winner detection.

Webhook event experiment.winner_detected may fire when a statistically significant winner is found.

  • Define goals before launching — changing goals mid-experiment affects comparability.
  • Prefer custom_event goals for reliable tracking across SPAs.
  • Use revenue goals when comparing average order value, not just conversion rate.
  • Align goal names with your analytics taxonomy (GA4, internal BI).