Skip to content
trackd.one

Web

A/B tests

Split tests right from the tracking script — no extra tools, no cookies.

Assign a variant and measure conversions

// Random variant on every page load
const variant = trackd.abtest('cta-color', ['teal', 'orange'])

// Optional seed (a value you already have, e.g. a logged-in user's plan
// or an order id — no personal data) → deterministic: same seed, same variant
const seeded = trackd.abtest('cta-color', ['teal', 'orange'], seed)

// Apply the variant
document.querySelector('.cta').style.color = variant

// Track the conversion when the goal happens
trackd.abconvert('cta-color')

How assignment works

Without a seed the variant is chosen randomly on every page load. With the optional third argument seed — a value you already have (no personal data) — the assignment is deterministic: the same seed always gets the same variant. There is no persistent per-visitor assignment (no cookies, no storage). Call abconvert() when the goal action happens.

Ready in minutes

Create a free account, add your website or app, copy the snippet.

Start for free