SDK API Reference
Methods on the global optimo object — track, identify, get variants, consent.
SDK API Reference
The Otter A/B SDK exposes a global optimo object you can call from anywhere on the page. Use it to track events, identify users, look up variant assignments, and manage consent.
Most of the SDK is invisible — variant assignment, DOM application, conversion tracking for click and pageview goals all happen automatically. The methods below are what you reach for when you need to drive the SDK from your own code: tracking custom events, attributing revenue, identifying logged-in users for cross-device assignment, and reading the current variant so you can branch your application logic.
The object lives at window.optimo once the SDK has loaded. Since the script is async, you can queue calls before the SDK is ready by pushing onto the queue at window.optimoq — the install snippet initializes that array for you, and the SDK replays the queue once it's initialized.
// Track a custom event
optimo.track("signup_complete", {
plan: "pro",
source: "landing_page"
});
// Track revenue
optimo.revenue({
value: 49.99,
currency: "USD"
});Frequently asked questions
Quick answers to the questions teams ask most about this part of Otter A/B.