ABTestHero

Add A/B tests to any website with just HTML attributes. No frameworks, no complex setup.

Free • 2KB minified • No signup required
<!-- Add A/B test to any element -->
<div class="abtest" data-abtestid="hero-button">
  <button data-abtext="Sign Up|Get Started|Join Now"
          data-abtrack="conversion">
    Sign Up
  </button>
</div>

<script src="https://cdn.abtesthero.com/abtesthero.min.js"></script>
<script>
  // Initialize and run (get API key from console first)
  abtesthero.init({apiKey: 'ak_your_key', user: {id: 'user123'}});
  abtesthero.runAll();
</script>

How It Works

Three simple steps to start A/B testing

1

Create API Key

Open browser console (F12) and run this command to get your free API key:

// Run this in browser console (F12)
abtesthero.createApiKey('you@example.com');

// Copy the API key from console output
2

Add HTML Attributes

Add test attributes to any HTML element you want to test:

<div class="abtest" data-abtestid="my-test">
  <h1 data-abtext="Hello|Hi|Welcome">Hello</h1>
  <button data-abtext="Sign Up|Join Now|Get Started"
          data-abtrack="conversion">
    Sign Up
  </button>
</div>
3

Initialize & Run

Initialize with your API key and run all tests:

// Initialize with your API key
abtesthero.init({
  apiKey: 'ak_your_key_here',
  user: {id: 'user123'}
});

// Run all tests on the page
abtesthero.runAll();

Works Everywhere

All modern browsers and frameworks supported

Chrome
v60+
Firefox
v55+
Safari
v12+
Edge
v79+

Get Started

Copy, paste, and start testing in 30 seconds

Complete HTML Example
<!-- 1. Include the script -->
<script src="https://cdn.abtesthero.com/abtesthero.min.js"></script>

<!-- 2. Add your A/B test -->
<div class="abtest" data-abtestid="hero-section">
  <h1 data-abtext="Welcome|Get Started|Join Us">Welcome</h1>
  <button data-abtext="Sign Up|Get Started|Join Now"
          data-abtrack="conversion">
    Sign Up
  </button>
</div>

<script>
  // 3. Initialize (get API key from console first!)
  abtesthero.init({
    apiKey: 'ak_your_api_key_here',  // Get this from console
    user: { id: 'user123' }
  });
  
  // 4. Run all tests
  abtesthero.runAll();
  
  // View results at: app.abtesthero.com/d/{test-id}
</script>
Download ABTestHero 2KB minified • No dependencies • MIT License