Skip to main content
Optimize runs A/B tests on your website through one tag. The API lets you do from your own systems everything the app does: create a test on a page, start and pause it, read its results, ship the winner, and record conversions the tag cannot see (a closed order, a signed contract). Webhooks tell you when a test starts, finds a winner, or ships.

Install the tag

Paste script_tag into the <head> of every page you want to test. The property is verified the first time the tag loads from the registered domain; GET /v1/optimize/properties shows verified_at.

Conversions across domains

For admitted pilot workspaces, Optimize can carry a visitor’s experiment identity from a page on one domain to a conversion page on another. It does not count the destination as another experiment impression. A conversion still needs a matching recorded exposure.
  1. Install the same property’s tag on both HTTPS sites.
  2. In Optimize settings, add each exact hostname to Allowed origins, then enable Track conversions across your domains. Only include sites you control and where your visitor consent permits this tracking. A parent hostname does not grant identity transfer to every subdomain.
  3. Mark ordinary same-window links between the sites:
For a programmatic checkout or navigation, wait for the tag to be ready, then decorate the URL before navigating:
The destination tag removes the reserved __rd_link fragment, preserving the rest of the fragment. The arrival link expires after five minutes and works only for the approved property and specific destination. An accepted receipt stays in that tab’s session storage for up to 24 hours, without extending on each page load. Repeated conversions remain deduplicated. Automatic link handling covers ordinary same-window clicks. Modified clicks, downloads, other window targets and noreferrer links keep their normal behavior. Use an explicit integration with rd.link() when decorating another navigation type. Forms, embedded third-party checkouts, and redirect chains that discard the fragment need a separately verified integration. If transfer is disabled or unavailable, the visitor can continue, but cross-domain attribution is not guaranteed. Never put a RevDesk API key in browser code.

Endpoints

All endpoints take the optimize:read scope for reads and optimize:write for changes.

Create and start a test

A test is a page, a goal, and one or more variants. Each variant is a list of DOM operations the tag applies for the visitors bucketed into it: setText, setAttribute, addClass, removeClass, setStyle, hide, and replaceHref. Nothing in the list can introduce script.
Goal types: form_submit, tel_click, cta_click, selector_click (each takes a selector), and url_visit (takes url_match_type and url_pattern). traffic_split (0.05 to 1) is the share of visitors enrolled; the rest see the page untouched.

Record a conversion

The tag counts goals it can see on the page. For outcomes that happen elsewhere, send them in. Include the tag’s visitor_id from the rd_vid cookie so the conversion can be matched to recorded exposure evidence. rd_sid is the session identifier in session storage, not the visitor cookie. Supplying an identity alone does not prove that the visitor saw an experiment.
metadata.order_id makes the write idempotent: a repeat returns recorded: false. value is in major units and defaults to USD; it shows up as revenue_cents per variant in results.

Read results

variants[] carries impressions, conversions, conversion_rate, lift, p_value, probability_to_beat_control, and revenue_cents. decision.reason is one of winner, collecting, no_difference, or inconclusive; decision.winner_variant_id is set only for winner. daily[] is a per-variant, per-day series for charts.

Events

Subscribe with webhooks. Site events are delivered flat and carry the event name in the body:
optimize.conversion.created carries conversion instead of test, in the same shape as GET /v1/optimize/conversions.