Skip to content

Preview and QA debug mode

Force a variant with a link, inspect what the snippet is doing on a page, and switch it off for one page view.

QA debug mode#

Add lift_debug=1 to any URL of your site to see what the snippet is doing there:

url
https://www.example.com/pricing?lift_debug=1

A small panel appears in the corner of the page and the snippet starts logging to the browser console. Like a preview, debug mode sticks to the tab until you turn it off with lift_debug=0. It changes nothing about how you are assigned or measured: you are looking at a normal visit.

The panel shows:

  • the mode of the page view (see the table below) and the version of the configuration that was loaded;
  • each experiment that targets the page, the variant in effect, and whether it was assigned or forced;
  • how many of the variant's changes are applied, how many are still waiting for their element to appear, and any that failed, with the reason;
  • the most recent events the snippet queued: page views, exposures, conversions, custom events;
  • a variant switcher per experiment. Choosing a variant starts a preview of it.
ModeMeaning
LiveAssigning, applying and tracking normally.
PreviewShowing forced variants. Nothing is stored or sent.
EditorThe visual editor is open: original page, no experiments, no tracking.
BlockedThe browser sent Do Not Track or Global Privacy Control, or consent was denied: original page, no storage, no events.
Waiting for consentThe site uses the opt_in consent mode and the page has not called lift.consent(true) yet.
OffSwitched off for this page view with lift_off=1, or no configuration could be loaded.
Turn debug mode offurl
https://www.example.com/pricing?lift_debug=0

From the console#

The same information is available as data, which is handy in automated checks and when a page's layout hides the panel:

js
// A snapshot of the snippet's state (null until the config has loaded).
lift.debug();

// Also turn console logging on and open the QA panel.
lift.debug(true);
What debug() returnsjson
{
  "version": "0.1.0",
  "mode": "live",
  "siteKey": "lift_pk_YOUR_SITE_KEY",
  "configVersion": 42,
  "url": "https://www.example.com/pricing",
  "visitorId": "k3J9…",
  "sessionId": "s8Qz…",
  "privacy": { "consentMode": "none", "blocked": false, "decision": null },
  "experiments": 2,
  "goals": 3,
  "active": [
    {
      "experimentId": "0198c1de-…",
      "experimentKey": "pricing-headline",
      "variantId": "0198c1df-…",
      "isControl": false,
      "forced": false,
      "status": { "total": 2, "applied": 2, "pending": 0, "failed": [] }
    }
  ],
  "events": [{ "t": "pv", "ts": 1767225600000 }]
}

In status, pending counts changes whose selector matches nothing yet, and failed lists changes that could not be applied, each with a reason: unsafe (rejected by a safety check), invalid_selector, unsupported or error.

Switching the snippet off#

To see a page exactly as it would be without the snippet doing anything — for example to rule it out while chasing a bug on your site — add lift_off=1:

url
https://www.example.com/pricing?lift_off=1

This applies to that one page view only and is not remembered. The global still exists, so calls your own code makes to lift.track() do not fail; they just do nothing.

A QA routine before starting#

  • Open the preview link of each variant on desktop and on a phone. Check the changed elements and what surrounds them.
  • With the debug panel open, confirm that every change is applied and none is pending or failed. Then navigate to another page and back.
  • Exit the preview and trigger the primary goal yourself — click the button, submit the form. A conversion event should appear in the panel's event list once the experiment is running and you are assigned to it.
  • If the site uses a consent banner, repeat once after declining: the page should be the original and the panel should report that nothing is tracked.

Your own visits count

Outside preview mode you are a visitor like any other. A handful of test visits does not move a result, but automated end-to-end tests against production might: run those with lift_off=1 or in preview mode.

Still stuck? The reasons a page shows the original are listed in When something goes wrong.