Goals
Pageview, click, custom event, revenue, and GA4 goal types.
Goals
A goal is the action you want to measure — a page reached, a button clicked, a purchase made. Each test can have multiple goals, but only one is marked primary. The primary goal drives statistical significance and the win/lose call on the results page; secondary goals are tracked for reference.
Goals are how Otter A/B turns “a visitor saw variant B” into “variant B is winning.” Every test needs at least one goal, and exactly one of them is the primary — the goal whose conversion rate (or revenue per visitor) drives the statistical decision on the results page. Secondary goals are reported alongside but do not affect whether a variant wins.
Choose the goal type that captures the conversion you care about as close to where it happens as possible. A click is a weaker signal than a checkout. A pageview of the “Thanks for signing up” page is stronger than a click on the signup button. A revenue event is the strongest signal of all because the dollar value is built in.
Pageview
pageviewCounts a conversion when the visitor lands on a specific URL. Works on hard navigations and on SPA route changes (the SDK re-evaluates the URL on every route push).
urlThe destination URL. Matched by origin + pathname case-insensitively. If you include ?query or #hash on the goal URL, those must also match.
Fires: Automatically by the SDK whenever the visitor URL matches the configured target.
Click
clickCounts a conversion when the visitor clicks any element matching a CSS selector. The SDK watches the DOM with MutationObserver and a short retry interval, so elements added after page load are still tracked.
selectorAny valid CSS selector — e.g. .signup-button, #checkout-cta, button[data-action="purchase"].
Fires: Automatically on the first click of any matching element. Subsequent clicks in the same session are deduplicated.
Custom Event
custom_eventCounts a conversion when your application code emits a named event via the SDK. Good for funnels that span multiple pages or non-click interactions like "video watched" or "form submitted".
event_nameThe exact event name your code passes to optimo.track(). Case-sensitive.
Fires: When your site calls optimo.track("event_name", { ...properties }).
Revenue
revenueA custom event with monetary value attached. Drives revenue-per-visitor and Welch's t-test analysis. optimo.revenue() is a shortcut that fires the "Purchase" event with value/currency — to use a different event name, call optimo.track() directly.
event_nameThe event name to listen for. Defaults to "Purchase" if you use optimo.revenue().currencyOptional. ISO currency code (USD, EUR, etc.) — used only for reporting/display.
Fires: When your site calls optimo.revenue({ value, currency, ...}) or optimo.track("event_name", { value, currency, ...}).
GA4 Event
ga4_eventPulls a Google Analytics 4 event in as a goal. Useful when your existing analytics already tracks the conversion. Requires an active GA4 connection on the project — without one, the goal will fail validation.
ga4_event_nameThe event name as it appears in your GA4 property (e.g. purchase, generate_lead, sign_up).
Fires: Server-side, when Otter A/B syncs new events from the connected GA4 property.
Goal library
Each project has a goal library — a set of reusable goal definitions you can drop into a new test in one click. When the project has saved goals, the wizard shows them as chips above the goals editor (labeled Quick add from your goal library). One click adds a new goal pre-filled with the saved name, type, and config; from there you can mark it primary, tweak it, or remove it like any other goal.
The library is scoped to a single project — each project keeps its own — so a goal you save in your marketing-site project won't appear in your app-checkout project. That keeps libraries focused on the conversions that actually matter for each surface.
Today, saving and removing entries in the library is API-driven rather than wizard-driven — there isn't a manage-templates screen in the dashboard yet. If your team would benefit from one, let support know; it's on the roadmap and customer demand decides ordering.
Primary goal and significance
Only the primary goal is used to declare a winner. If you don't mark one, the results page treats the test as inconclusive until you do. Switching the primary goal after a test starts is allowed but will recompute significance from the new goal's conversions, which can change the apparent "winning" variant — generally a sign you should rerun the test with the right goal from the start.
Goal tips
Pick the goal closest to the value you actually want. A click is a weaker signal than a checkout. A “Thanks for signing up” pageview is a stronger signal than a click on the signup button. Where you can, anchor the goal as close to the moment of value as possible.
One primary, two to four secondaries. The primary drives the win/lose call; secondaries give context. Tracking too many goals dilutes attention and invites cherry-picking after the fact.
Use Revenue when there's real money attached. Conversion-rate goals miss the difference between “more orders” and “more revenue”. If the test could plausibly change average order value, score it on revenue.
Avoid switching the primary mid-test. It's allowed but recomputes significance from a different metric, which can flip the apparent winner. If you find yourself wanting to switch, that's usually a sign the test should be rerun.
Frequently asked questions
Quick answers to the questions teams ask most about this part of Otter A/B.