Custom events
Count actions that happen in your own code, with an order value for revenue goals. Paid plans.
ABTest.track('signup');
ABTest.track('purchase', { revenue: 49.99 });Developers
One script tag for the browser, a secret key for your backend, and a REST API for results. Assignment is deterministic, so the browser and your server always agree on a visitor's version.
Get started
Sign in and add the domain you will test on. Browser keys only work on the domains you register.
Add your domainEach project has dev, staging and production environments, each with its own keys.
Environments and keysPut the snippet in the head of every page in the test. It starts on its own.
Install the SDKSet the variations and goal in the dashboard, check each version with a preview link, then start.
Start the test<script src="https://www.freeabtest.com/sdk.js" data-key="cro_pk_prod_..." async></script>One script tag assigns visitors, applies versions, handles split URL redirects and counts click, form and page visit goals. The browser SDK is this script tag; there is no package to install.
Integration examples
Copied from the docs. Replace the keys with your own from API keys in the dashboard.
Count actions that happen in your own code, with an order value for revenue goals. Paid plans.
ABTest.track('signup');
ABTest.track('purchase', { revenue: 49.99 });Render your own component for the visitor’s version, for example in a single-page app.
ABTest.bootstrap().then(function (r) {
if (r.matched && r.variation_name === 'Variant B') {
document.body.classList.add('variant-b');
}
});Use a secret key from your backend. The same visitor ID gets the same version as in the browser.
curl -X POST https://www.freeabtest.com/api/server/assign \
-H 'Authorization: Bearer cro_sk_prod_...' \
-H 'Content-Type: application/json' \
-d '{"experiment_id": "exp_123", "user_id": "user_42"}'Conversion rates, Wilson intervals and the winner, filtered to one environment if you like.
curl 'https://www.freeabtest.com/api/experiments/exp_123/results?environment=prod' \
-H 'Authorization: Bearer cro_sk_prod_...'JavaScript SDK
For a standard test you call nothing: the snippet matches the page, assigns the visitor, applies the version and counts goals. These methods are for everything else.
SDK calls catch their own errors and log them to the console, so a failure never breaks your page.
REST API
SDK keys call the browser endpoints. Secret keys call the server and management endpoints, and only see their own project. Experiments are created in the dashboard.
Assign a visitor from a browser or app.
SDK key
Record a page view or a conversion.
SDK key
Assign a visitor from your backend.
Secret key
Send up to 50 page views and conversions in one request.
Secret key
List the experiments in the key’s project.
Secret key
Change the name, description, traffic or status.
Secret key
Rates, intervals, lift and the winner.
Secret key
Send every visitor to one version.
Secret key
A preview link for automated browser tests, never counted.
Secret key
curl -X POST https://www.freeabtest.com/api/server/track \
-H 'Authorization: Bearer cro_sk_prod_...' \
-H 'Content-Type: application/json' \
-d '{"events": [{"experiment_id": "exp_123", "variation_id": "var_b",
"user_id": "user_42", "event_type": "conversion", "goal_id": "goal_1"}]}'Keys and environments
Use a dev key locally, a staging key on staging and a production key on the live site. Events carry the environment of the key, so test traffic stays out of real results.
cro_pk_<env>_...cro_sk_<env>_...Keys are shown once when you create them and stored hashed.
Webhooks
Paid plansA JSON POST to your https endpoint, with retries if it fails. Each delivery has a signature header so you can check it came from us.
test.winner: A running test found a winner on its primary goal.test.completed: A test was stopped by hand, on schedule or by a rollout.test.srm_warning: The visitor split does not match the weights.quota.reached: Your organization used its monthly tested visitors.{
"id": "whd_8k2j...",
"event": "test.winner",
"created_at": "2026-10-19T08:30:00.000Z",
"data": {
"experiment": { "id": "exp_123", "name": "Homepage CTA", "status": "running" },
"winner": { "variation_id": "var_456", "name": "Variation 1" },
"visitors": 4210
}
}Integrations
Add the snippet as a custom HTML tag. Test views are pushed to the dataLayer.
Read the guidePaste the snippet with any header plugin, or use our plugin on paid plans.
Read the guideAn experience_impression event for each test view, to compare versions in your reports.
Read the guideCall bootstrap on each route change, for example in a React effect.
Read the guideDocumentation
How results are calculated: experiment analytics and statistical methodology.
Free plan with 10,000 tested visitors a month and 1 running test. No card needed.