@firstandthird/ab-test

2.0.0 • Public • Published

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.

/@firstandthird/ab-test/

    Package Sidebar

    Install

    npm i @firstandthird/ab-test

    Weekly Downloads

    1

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    62.6 kB

    Total Files

    6

    Last publish

    Collaborators

    • alaguna
    • aleperez92
    • dawnerd
    • ecwillis
    • jga
    • orthagonal1