Launch your first A/B test in under 5 minutes — no complex setup, no heavy dependencies.
Each project has its own API key and can contain unlimited experiments. Use separate projects for different websites or apps.
Add the tracking snippet to every page you want to test. Place it in the <head> for best performance:
<!-- Anti-flicker: hides page until variant is applied -->
<style>.sw-cloak { opacity: 0 !important; }</style>
<body class="sw-cloak">
<!-- SplitWisp SDK (~3KB gzipped, zero dependencies) -->
<script src="https://cdn.splitwisp.com/sdk/v1/tracker.umd.js"></script>
<script>
SplitWisp.init({
apiKey: 'YOUR_API_KEY',
endpoint: 'https://api.splitwisp.com',
});
</script>
Or install via npm for bundled apps:
npm install @splitwisp/tracker
import { Tracker } from '@splitwisp/tracker';
const tracker = new Tracker({
apiKey: 'pk_live_abc123',
endpoint: 'https://api.splitwisp.com',
});
await tracker.init();
The SDK automatically:
See the SDK Reference for the full API and configuration options.
The fastest way to create A/B tests — no code changes required:
The visual editor supports 16 change types including text, innerHTML, background color, font size, hide/show, add/remove CSS classes, and custom attributes. See the Visual Editor Guide for the full walkthrough.
For experiments that require logic beyond visual changes:
SplitWisp.init({
apiKey: 'YOUR_API_KEY',
endpoint: 'https://api.splitwisp.com',
}).then(function (tracker) {
var variant = tracker.getVariant('exp_hero_headline');
if (variant && variant.variantName === 'short') {
document.querySelector('h1').textContent = 'Ship faster.';
}
});
You have two options for tracking conversions:
Configure goals in the dashboard when creating your experiment — no code needed. SplitWisp supports five goal types:
/thank-you).buy-button)Goals are deduplicated per session — each goal fires at most once per visitor. See the Conversion Goals Guide for setup details and best practices.
For custom conversion logic, call trackConversion directly:
// Track a purchase conversion with revenue value (in cents)
document.querySelector('#buy-button').addEventListener('click', () => {
tracker.trackConversion('exp_pricing_cta', 4999); // $49.99
});
// Track a simple conversion without revenue
tracker.trackConversion('exp_signup_flow');
Learn more about interpreting results in Understanding A/B Test Results.
Once you have a statistically significant winner:
See Experiment Lifecycle for the full status flow including pause, resume, duplicate, and revert.