Docs
Install with a script tag
Works on any site: plain HTML, Webflow, Shopify, Squarespace and Wix. Add your site in the dashboard, then paste its snippet as high as possible in the <head>:
<script src="https://absplits.com/s.js" data-key="YOUR_SITE_KEY"></script>
- Webflow: Site settings → Custom code → Head code.
- Shopify: Online Store → Themes → Edit code →
theme.liquid, just after<head>. - Squarespace: Settings → Advanced → Code injection → Header.
- Wix: Settings → Custom code → Add code → Head, all pages.
Then press Check installation in the dashboard for the green tick. The page hides for at most 800 ms on a first visit while variants apply. Change it with data-timeout="500".
WordPress
The plugin (zip install, settings screen for your site key, cache-plugin compatibility) is coming soon. Until then, add the script tag with any header-scripts plugin. Variants apply in the browser, so page caches like WP Rocket, LiteSpeed and Cloudflare don't break the split.
Next.js
The middleware package for flicker-free, server-rendered splits at the edge is coming soon. For now, add the script to your root layout:
import Script from "next/script"; <Script src="https://absplits.com/s.js" data-key="YOUR_SITE_KEY" strategy="beforeInteractive" />
Goals & revenue
Click, form-submit and page-view goals need no code. Set them on the test. For anything else:
// Custom event goal
ABSplits.track("signup_completed");
// Revenue goal (e.g. on your order confirmation page)
ABSplits.revenue(49.00);
// Which variant is this visitor in?
ABSplits.variant("EXPERIMENT_ID"); // → "Variant B" | nullGA4
If gtag or GTM's dataLayer is on the page, every exposure sends an absplits_exposure event with absplits_experiment and absplits_variant, and sets a user property per test. Register absplits_variant as a custom dimension in GA4 to slice any report by variant.
Cookie consent
AB Splits sets no cookies. It stores a random visitor ID in localStorage so each visitor sees the same variant. For UK and EU visitors, have it wait for consent:
<script src="https://absplits.com/s.js" data-key="YOUR_SITE_KEY" data-consent="wait"></script> // Call this from your cookie banner's "accept" callback ABSplits.consent();
Preview and exclusions
Preview a variant. On any test, press Preview on your site next to a version. It opens your live page showing that version, even before you start the test, and records nothing. The link is signed and works for 7 days, so you can send it to a colleague or client.
What the snippet ignores. It never runs tests for search bots and crawlers, headless browsers, the Shopify theme editor, WordPress previews and customizer, Elementor, Divi, Beaver Builder, Oxygen or Bricks editors, or logged-in WordPress users. Your own visits and your builders don't count as visitors.
Exclude yourself. Visit any page of your site with ?absplits_off=1 to opt that browser out for good, and ?absplits_off=0 to opt back in.
Set up with AI
Your AI assistant can do the setup for you, three ways:
- Copy a prompt. On your site's page in the dashboard, press Set up with AI and paste the instructions into Claude, ChatGPT, Codex, Cursor or Claude Code. It knows where the snippet goes on each platform.
- Point it at our docs. /llms.txt is a plain-text guide written for AI assistants: install steps, the JavaScript API and the MCP tools.
- Connect over MCP. Create an API key in Settings → AI assistants, then your AI can add sites, create tests, write variants, start them, read results and ship winners from a chat.
# Claude Code
claude mcp add --transport http absplits https://absplits.com/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
# Codex: ~/.codex/config.toml
[mcp_servers.absplits]
url = "https://absplits.com/mcp"
bearer_token_env_var = "ABSPLITS_API_KEY"
# Cursor: .cursor/mcp.json
{ "mcpServers": { "absplits": { "url": "https://absplits.com/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" } } } }Tools: list_sites, create_site, get_install_snippet, check_install, list_tests, create_test, add_variant, generate_variants, set_test_status, get_results, ship_winner. Claude.ai and ChatGPT web connectors need OAuth sign-in, which is coming soon; the desktop and command-line apps work today.