Landing Platform Landing Platform
Developer A/B Testing
GET /api/public/experiences/{containerId} Public · no auth

Get active experiences for a container

Return all active A/B experiences configured for a tag container or experiment site. Called by the experimentation client script on every page load. Accepts both LT- (tag container) and EX- (standalone experiment site) key formats. Responses are cached for one hour; add lt_preview, lt_exp, or lt_qa to bypass the cache and include paused and draft experiences for testing.

Path parameters

containerId
string required
—

Query parameters

lt_preview
string optional
Any value — enables preview mode (bypasses cache, includes draft/paused).
lt_exp
string optional
Any value — alias for lt_preview.
lt_qa
string optional
Any value — alias for lt_preview.

Responses

200 { "success": true, "experiences": [ { "id": 3, "experienceId": "exp_abc123", "na...
400 { "error": "Invalid key" }
404 { "error": "Container not found" }
response
{
  "success": true,
  "experiences": [
    {
      "id": 3,
      "experienceId": "exp_abc123",
      "name": "Hero CTA Test",
      "type": "ab",
      "status": "active",
      "primaryUrl": "https://example.com/",
      "variations": [
        { "id": 7, "name": "Control", "weight": 50, "css": "", "js": "" },
        { "id": 8, "name": "Variant A", "weight": 50, "css": ".hero { background: red; }", "js": "" }
      ],
      "goals": [],
      "locations": [],
      "globalCss": "",
      "globalJs": ""
    }
  ],
  "preview_mode": false
}
POST /api/public/experience/segment Public · no auth

Place a visitor into a segment

Place a visitor into a custom segment (an audience of type "segmentation" belonging to the site's account), for the report's segment filter. The segment may be named by its id or by the id it carried in a previous tool. Always 200; nothing is written until the analytics store has the segments table.

Rate limited.

Body parameters

auto-derived
site_key
string required
EX- (site) or LT- (container) public key. Required. max: 40
visitor_id
string required
The visitor's id (lt_visitor_id). Required. max: 64
segment_id
string required
The segment's id. Required. max: 64

Responses

200 { "success": true, "recorded": true }
POST /api/public/experience/segment
response
{ "success": true, "recorded": true }
POST /api/public/experience/convert Public · no auth

Record a goal conversion for a visitor

Record that a visitor completed a conversion goal within an experience. Writes a single fire-and-forget row to the analytics store; analytics failures never block the visitor. Per-visitor deduplication is handled server-side by the ReplacingMergeTree engine on (experience_id, goal_id, visitor_id).

Rate limited.

Body parameters

auto-derived
experience_id
string required
Public experience identifier string (e.g. exp_abc123). Required.
variation_id
integer required
Numeric ID of the variation the visitor was assigned. Required.
goal_id
integer required
Numeric ID of the goal that was triggered. Required.
visitor_id
string required
Anonymous visitor UUID — max 64 chars. Required. max: 64
url
string optional
Full URL of the page where the conversion occurred.
revenue
number optional
Optional decimal revenue value associated with this conversion. min: 0
metadata
object optional
Optional key-value object for additional conversion context.
page_id
integer optional
—

Responses

200 { "success": true }
404 { "error": "Experience not found" }
response
{ "success": true }
POST /api/public/experience/qa Public · no auth

Record a preview session's QA events

Record what a preview / QA session of a test just did, for the live QA console.

Rate limited.

Body parameters

auto-derived
site
integer required
The experimentation site id the preview payload named. Required.
token
string required
The QA token from the preview payload. Required. max: 64
sid
string required
The preview session's own id (random, per browser tab session). Required. max: 40
by
string optional
Who is testing, when the preview link named them. max: 60
device
object optional
{browser, os, device} — for the console's "Safari on iOS · phone".
now
number optional
The browser's clock (ms) when it posted, to keep event spacing.
events
object required
Up to 50 events: {t, exp, type, …}. max:
POST /api/public/experience/qa
POST /api/public/experience/reveal Public · no auth

Record a sampled page reveal time

One sampled visitor's time-to-reveal (ms) under the anti-flicker, for the tests that ran on the page. Feeds the report's "page shows without flicker" and the reveal alert.

Rate limited.

Body parameters

auto-derived
exps
object required
Public ids (EXP-…) of the tests activated on the page. Required. max: 20
ms
number required
Milliseconds the page stayed hidden. Required. min: 0
timed_out
boolean optional
True when the anti-flicker timeout showed the page first.
POST /api/public/experience/reveal
POST /api/public/experience/goal Public · no auth

Record a site-wide goal conversion

Record a site-wide goal conversion. The page binds one listener set from the served siteGoals block and posts ONCE per conversion; the server credits every experiment on the site that carries the goal and that the visitor has a session in, in the arm the session recorded. Imported tests not yet live on Landing, and visitors with no session, are never credited. Always 200 — analytics never blocks the visitor.

Rate limited.

Body parameters

auto-derived
site_key
string required
EX- (site) or LT- (container) public key. Required. max: 40
visitor_id
string required
The visitor's id (lt_visitor_id). Required. max: 64
goal_template_id
integer optional
The library goal's id (siteGoals.goals[].templateId). Send this or public_id. min: 1
public_id
string optional
The goal's public id (siteGoals.goals[].publicId), as snippets use it. max: 100
revenue
number optional
Optional order value for a revenue goal. min: 0
order_id
string optional
Optional order / transaction id — the same order is counted once, however many times it is reported.
url
string optional
The page the conversion happened on.
active_experiences
object optional
Experiments that ran on this page (experienceId values). Goals set to "Track only on used experiences" count only for these. max: 100

Responses

200 { "success": true, "credited": 2 }
response
{ "success": true, "credited": 2 }
POST /api/public/experience/session Public · no auth

Record a visitor session assignment

Record that a visitor was assigned to an experience variation. Writes a single fire-and-forget row to the analytics store; the response is always 200 so a slow or unavailable analytics backend never blocks the visitor's page. Duplicate inserts for the same visitor are deduplicated server-side by the ReplacingMergeTree engine.

Rate limited.

Body parameters

auto-derived
experience_id
string required
Public experience identifier string (e.g. exp_abc123). Required.
variation_id
integer required
Numeric ID of the variation the visitor was bucketed into. Required.
visitor_id
string required
Anonymous visitor UUID — max 64 chars. Required. max: 64
session_id
string optional
The browser's session id (the lt_session cookie), so the session matches Web Analytics'.
url
string optional
Full URL of the page where the experience ran.
referrer
string optional
HTTP referrer URL.
user_agent
string optional
Browser user-agent string, hashed server-side before storage. Long values are cut, never refused.
browser
string optional
Browser name, lower-case (chrome, safari, firefox, edge, opera).
os
string optional
Operating system, lower-case (windows, macos, ios, android, linux).
visit_count
integer optional
How many visits this visitor has made, including this one. min: 0
is_returning
boolean optional
Whether the visitor has been before (defaults to visit_count > 1).

Responses

200 { "success": true, "session_id": "x7kq2mplz3vw9t4r" }
404 { "error": "Experience not found" }
response
{
  "success": true,
  "session_id": "x7kq2mplz3vw9t4r"
}
GET /api/public/experiment-config/{key} Public · no auth

Render-blocking experiment config script

Render-blocking config script for the no-flicker (synchronous) delivery.

Returns JavaScript (not JSON) so the embed can load it with a SYNCHRONOUS <script src> in <head>: the browser blocks parsing until it executes, so variation CSS/DOM changes apply BEFORE first paint (no flash of original content). It inlines the per-request visitor context (geo) + the experiences config and calls LTExperience.init immediately — no extra fetch round-trip.

Because it carries per-visitor geo + drives bucketing, it is never cached (no-store); only the experiences list it embeds comes from the shared per-site app cache. Geo therefore works on this path for BOTH EX- and LT- keys (unlike the CDN-cached JSON container config).

Path parameters

key
string required
— pattern: [A-Za-z0-9\-]+(\.js)?
GET /api/public/experiment-config/{key}
POST /api/public/experience/ga4-seen Public · no auth

Report the GA4 tag found on a page

The GA4 tag the experiment engine found on a page, for the Google Analytics setup check ("is the tag there?") — needs no Google API.

Anonymous and open-CORS: it only ever stores a well-formed measurement id against the experiment's own site, in the cache, for a few days.

Rate limited.

Body parameters

auto-derived
experience_id
string required
Public id of an experiment running on the page (EXP-…). Required. max: 64
tag
string required
GA4 measurement id found on the page (G-…). Required. max: 32
host
string optional
The page's host name. max: 255
POST /api/public/experience/ga4-seen
GET /api/public/experience/context Public · no auth

Visitor targeting context (place + weather)

The visitor's place (and, when the site's tests use it, the weather there this hour) — exactly what the no-flicker snippet's config script inlines as window.__LT_CTX__. The Landing tag asks for it once a session, and only when its edge-cached config says a served test has a place or weather rule; without it those rules can never match on that path.

Place comes from Cloudflare's visitor headers, believed only when the connection came from Cloudflare (VisitorContext). Weather is read from the cache only: a miss queues the lookup for that place and hour and answers without weather — this request never calls a provider. Nothing is stored and no cookie is set; the answer is never cached by anyone.

Rate limited.

Query parameters

k
string optional
The LT- (Landing tag) or EX- (experiment site) public key.
lt_env
string optional
`staging` on one of the site's staging hosts.

Responses

200 { "country": "GB", "region": "ENG", "city": "Norwich", "continent": "EU", "weath...
400 { "error": "Invalid key" }
response
{ "country": "GB", "region": "ENG", "city": "Norwich", "continent": "EU", "weather": "rain", "temperature": 9.5 }