A NoTambourine microlib

ntb

Sticky A/B bucketing you paste, not install. ntb('hero') returns a variant, remembers it per browser, and reports the exposure to your analytics.

Format
Language
Tracking
Extras
ntb.js

Use it

const variant = ntb('hero');      // 0 or 1, sticky for this browser
if (variant === 1) document.body.classList.add('hero-b');

ntb('cta-copy', 3);               // three-way test → 0, 1, or 2

Assignment is uniform random, persisted in localStorage under ntb:<test>. The exposure fires once per test per page load — SPA route changes don't re-fire it. Analyze by unique visitors per variant, not raw events.

Where exposures land