Landing Platform API
Developer documentation
Build on the Landing Platform — capture leads, sync subscriber data, and track engagement programmatically. Every endpoint below is generated directly from the live API, so this reference is always in step with what the platform actually does.
All requests are made over HTTPS to landing.pivotal.digital.
Responses are JSON. Start with Authentication,
then jump to the resource you need from the sidebar.
https://landing.pivotal.digital
Getting started
Authentication
The API uses different schemes depending on the resource. Each endpoint shows its scheme as a badge next to the method.
Public endpoints
Lead capture and tracking endpoints need no authentication — they're designed to be called from public web pages. They're spam-filtered and rate-limited.
API token
Data endpoints take a per-list API token in the request path. Generate one under Settings → Subscriber lists → API access. Tokens are list-scoped and revocable.
Signing writes (HMAC)
When a list has a secret configured, every write must include an
X-Signature: sha256=<hmac>
header — the HMAC-SHA256 of the raw request body keyed with your secret. We
verify with a constant-time comparison.
Sign in with Landing (OAuth 2.1)
Apps that act for a signed-in person (the WordPress plugin, AI agents) never take a pasted
key. They discover the endpoints at
/.well-known/oauth-authorization-server,
register themselves, and send the person to a consent screen (authorization code + PKCE S256).
The access token is sent as Authorization: Bearer …,
lasts an hour, and is refreshed with a rotating refresh token. It only works on the API it was
issued for, and only ever sees what the person who approved it can see.
Errors
Responses use standard HTTP status codes. Any endpoint with required parameters returns
422
on a validation failure, with the shape
{ "message": "…", "errors": { "field": ["…"] } }.
Resource-specific failures (not found, bad signature, business rules) return
{ "error": "…" }
with an appropriate 4xx/5xx code — see each endpoint's responses.
Keep secrets server-side and send all requests over HTTPS. Never embed a secret in client-side code.
BODY='{"external_id":"u_88","email":"a@b.com"}'
SIG=$(printf '%s' "$BODY" \
| openssl dgst -sha256 -hmac "$SECRET" \
| awk '{print $2}')
curl -X POST \
"https://landing.pivotal.digital/api/subscribers/$TOKEN/upsert" \
-H "Content-Type: application/json" \
-H "X-Signature: sha256=$SIG" \
-d "$BODY"
In the browser
Experiments JavaScript API
On a page running A/B tests, the tag exposes one object,
window.LT.experiments.
Use it in your test code, in the site's Global JS, or anywhere on your pages.
window.LTExperience and
window.landing are the same object under older names.
Code that runs before the tag has loaded can queue commands on
window._lt_q instead —
['convert', goalId, revenue],
['activate', locationId],
['segment', segmentId].
Nothing is recorded in preview or QA mode.
- convert(goalId, revenue?, meta?)
- Record a goal. goalId is the goal's id from its settings (or a Tag Manager conversion's event name). revenue is a number, or an object { revenue, order_id }. A goal shared by several tests is counted once per conversion, for every test the visitor is in.
- activate(locationId)
- Activate a location whose trigger is "Manually". Safe to call before the tag has loaded.
- segment(segmentId)
- Place the visitor in a custom segment, for filtering results.
- visitorData({ field: value })
- Tell targeting about the visitor (plan, tier, orders). Kept in this browser; the "Visitor data" condition reads it. Also _lt_q.push(['visitorData', {…}]) or window.LT_VISITOR.
- page({ type, product, category, cart, customer })
- Tell targeting about this page: type (home, category, product, cart, checkout, purchase…), product { sku, name, price, category }, category { id, name }, cart { value, items }, customer { id, loggedIn }. Also window.LT_PAGE. Set it before the snippet runs; the standard data-layer shop events and Product JSON-LD are read too.
- waitFor(selector, callback, timeout?)
- Call back with the matching elements as soon as they exist (default timeout 10 s).
- $
- jQuery (loaded for you if the page has none).
- _$(selector)
- Like $, but waits: _$('.price').addClass('new') runs the moment .price appears. Chain setters; read values with $.
- runSiteGlobal(css, js)
- Run site-wide code in the page's global scope — what the site Global CSS/JS boxes use.
- assign(experienceId, variationId)
- Put this visitor in a variation (sets their lt_exp_ cookie). Returns false for a variation the test doesn't have.
- tapQueue(name, handler)
- Listen to a command queue on window (window[name].push). Items already queued are handed over first, and the page's own push keeps working.
- registerAdapter({ name, preAssign?, onReady? })
- For integrations. preAssign(experience) may return the variation id a visitor already has elsewhere; onReady(api) runs once before tests activate.
- getVisitorId() · getCurrentVariation(experienceId)
- Read the visitor id, and the variation applied on this page.
- consent.grant() · consent.withdraw() · consent.status()
- For a custom cookie banner when the site waits for consent.
- isDisabled()
- True when tests are switched off for this visit (see the lt_disable parameter below).
- addPreviewToggle({ key, label, on, onChange(on), onExit?(url) })
- Add a switch to the preview bar testers see, e.g. to hide another tool while comparing. Only appears in preview.
Switching tests off for a visit
Add a parameter to any page address. Off means no test is applied, nobody is placed in a variation or counted, nothing is sent to Google Analytics, and the page shows at once. The rest of the tag (analytics, forms) carries on.
- ?lt_disable=1
- Off for this page view only.
- ?lt_disable=session
- Off for the rest of this browser session, on every page, with no parameter needed.
- ?lt_disable=0
- Back on.
In preview, the bar's Hide Landing switch does the same, so you can compare a page with and without its tests.
A sale reported with LT.track('purchase', { revenue, transaction_id })
or a Google Analytics purchase event also counts towards your revenue goals.
Pass the order id, so an order we also hear about from your store is counted once.
Sending the variation to other tools
Switch tools on per site (Experiments › Configuration › Integrations) or per test (Set-up › Integrations).
When a visitor enters a test, Landing makes these calls — only if that tool's own script is on the page,
once per visitor per test per browser session, never in preview or QA, and only once the visitor may be
tracked under your consent setting. Google Analytics 4 gets gtag('event', 'experience_impression', { experiment_id, experiment_name, variant_id, variant_name }).
- Tag Manager (dataLayer)
- dataLayer.push({ event: 'lt_experiment', experiment_id: …, experiment_name: …, variation_id: …, variation_name: … })
- Pushes an object into window.dataLayer, so a Tag Manager trigger on the event can send it anywhere.
- Microsoft Clarity
- clarity('set', testName, variationName)
- Sets a custom tag (the test's name = the variation's name), so recordings and heatmaps filter by variation.
- Hotjar
- hj('event', 'lt_experiment_<test key>_<variation id>')
- Sends an event per test and variation, so recordings and heatmaps filter by it.
- Mixpanel
- mixpanel.track('$experiment_started', { 'Experiment name': …, 'Variant name': …, experiment_id: …, variation_id: … })
- Tracks "$experiment_started" with "Experiment name" and "Variant name", the names Mixpanel's experiment report reads.
- Segment
- analytics.track('Experiment Viewed', { experiment_id: …, experiment_name: …, variation_id: …, variation_name: … })
- Tracks "Experiment Viewed" (Segment's own A/B testing event), which Segment passes on to every tool it feeds.
- Amplitude
- amplitude.track('Experiment Viewed', { experiment_id: …, experiment_name: …, variation_id: …, variation_name: … })
- Tracks "Experiment Viewed" with the test and variation.
- Heap
- heap.track('Experiment Viewed', { experiment_id: …, experiment_name: …, variation_id: …, variation_name: … })
- Tracks "Experiment Viewed" with the test and variation.
The lt:experiment page event
For any other tool, listen on document.
It fires on every page a test is applied (not just once a session), always — including in preview, where
detail.preview is
true so you can skip it.
var exp = window.LT.experiments;
// Change an element that renders late
exp._$('.hero h1').text('Sleep better tonight');
// Count a goal when the visitor opens the size guide
exp.waitFor('#size-guide', function (els) {
els[0].addEventListener('click', function () {
exp.convert(1042);
});
});
// Before the tag has loaded
window._lt_q = window._lt_q || [];
window._lt_q.push(['activate', 'basket-drawer']);
// Hear about every test on the page
document.addEventListener('lt:experiment', function (e) {
// e.detail = { experimentKey, experimentName,
// variationId, variationName, isOriginal, preview }
if (e.detail.preview) return;
myTool.track('Experiment', e.detail);
});
API resources
A/B Testing
10 endpoints
Affiliate
1 endpoint
Booking
4 endpoints
Cookie consent
1 endpoint
Email Tracking
6 endpoints
Embeds & Widgets
4 endpoints
Express Checkout
4 endpoints
Leads
9 endpoints
Live Chat
6 endpoints
Referrals
1 endpoint
Reviews
1 endpoint
Shop links
1 endpoint
Sites
9 endpoints
Subscriber Events
1 endpoint
Subscriber Records
3 endpoints
Tag Manager
5 endpoints
Tracking & Analytics
6 endpoints
Web Analytics
1 endpoint
Webhooks
3 endpoints
Outgoing webhooks
1 endpoint
Landing Platform