2.0.0 • Published 6 years ago

@firstandthird/ab-test v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

AB Test npm

Simple A/B Testing library using Domodule and Micro Metrics

Installation

npm install @firstandthird/ab-test

Usage

JavaScript

import '@firstandthird/ab-test'

HTML

<body>
  <!-- Additional given data will be passed along too -->
  <div data-module="ABTest" data-module-name="backgroundColor" data-module-value="red">
    <a href="" data-action="success" data-action-text="Test">Test</a>
    <a href="" data-action="success" data-action-text="Foo">Foo</a>
  </div>

  <!-- If action is not defined, assume click on element -->
  <a href="" data-module="ABTest" data-module-name="ctaText" data-module-value="Sign up Now">Sign up now</a>
</body>

It needs to receive some options or they should be defined on the window object:

  • url: data-module-url as an option or have metricsEndpoint defined on the window object.
  • session: data-module-session-id as an option or have metricsSession defined on the window object.
2.0.0

6 years ago

1.1.0

8 years ago

1.0.0

8 years ago