Skip to content

Getting started

This checklist takes you from an empty dashboard to a running live test. Prerequisites: a usertrax account and access to your page’s HTML <head> (or one of the integrations).

  1. Create a domain

    Sign in to the usertrax dashboard, go to Domains, and add your website. Copy the API key.

  2. Install the tracking script

    Add the script to the <head> (replace the key):

    <script
    src="https://usertrax.io/cvs.js"
    data-key="YOUR_API_KEY"
    defer
    ></script>

    Details and alternatives: Quick Start.

  3. Prepare a conversion goal

    Make sure at least one event fires (e.g. purchase or signup) — via push() or data-usertrax. That becomes your test’s primary goal.

    See Events & Parameters.

  4. Create your first A/B test

    In the dashboard under A/B TestsCreate New Test: test key, primary goal, traffic split, and at least two variants. Step by step: Creating tests.

  5. Serve a variant on the page

    Pick an approach:

    • HTML visibility — elements with data-usertrax-ab-test-* (simplest path)
    • CSS/JS in the variant config — changes without duplicated markup
    • Custom logicwindow.usertrax.getVariant(...) in your code
  6. Verify live

    Open the page in a private window and check the console:

    window.usertrax.getAssignments();

    Fire a test conversion and confirm sessions (and conversions) appear under A/B Tests → Analytics.


A/B testing is enabled by default once the tracking script runs and active tests exist for the domain in the dashboard. You control behavior via tracker configuration (usertraxConfig) and test settings in the dashboard — not via a separate feature flag on the script.

On page load, the A/B testing system:

  1. Loads active tests — At session start, the tracker fetches active tests and assignments for the domain.
  2. Applies the variant — CSS is injected into <head>, variant JS runs, HTML visibility is set.
  3. Stores the assignment — The variant is saved in sessionStorage under usertrax_ab_<test_key> so the session stays stable.
  4. Attaches to conversions — Every conversion event automatically receives ab_test_data with the current assignments.
// Not required: manual load or apply
// The tracker initializes A/B tests with the session

Once cvs.js is loaded and the session is ready, variants are active. For your own conditional logic, getVariant is enough — see JavaScript API.