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).
10-minute checklist
Section titled “10-minute checklist”Create a domain
Sign in to the usertrax dashboard, go to Domains, and add your website. Copy the API key.
Install the tracking script
Add the script to the
<head>(replace the key):<scriptsrc="https://usertrax.io/cvs.js"data-key="YOUR_API_KEY"defer></script>Details and alternatives: Quick Start.
Prepare a conversion goal
Make sure at least one event fires (e.g.
purchaseorsignup) — viapush()ordata-usertrax. That becomes your test’s primary goal.See Events & Parameters.
Create your first A/B test
In the dashboard under A/B Tests → Create New Test: test key, primary goal, traffic split, and at least two variants. Step by step: Creating tests.
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 logic —
window.usertrax.getVariant(...)in your code
- HTML visibility — elements with
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.
Basic configuration
Section titled “Basic configuration”Enabling A/B testing
Section titled “Enabling A/B testing”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.
Automatic initialization
Section titled “Automatic initialization”On page load, the A/B testing system:
- Loads active tests — At session start, the tracker fetches active tests and assignments for the domain.
- Applies the variant — CSS is injected into
<head>, variant JS runs, HTML visibility is set. - Stores the assignment — The variant is saved in
sessionStorageunderusertrax_ab_<test_key>so the session stays stable. - Attaches to conversions — Every conversion event automatically receives
ab_test_datawith the current assignments.
// Not required: manual load or apply// The tracker initializes A/B tests with the sessionOnce cvs.js is loaded and the session is ready, variants are active. For your own conditional logic, getVariant is enough — see JavaScript API.
- Script starts (
window.usertraxas queue, then API) - Session init loads
ab_test_config - Assignments are set and CSS/JS applied
- HTML elements with
data-usertrax-ab-test-*are shown/hidden - Later conversions carry the test context
Next steps
Section titled “Next steps”- Creating tests — primary goal, traffic split, targeting
- HTML variants — markup without custom JS
- Troubleshooting — when nothing is visible or the assignment “sticks”