@firstandthird/ab-test
v2.0.0
Published
Simple A/B testing using Domodule and Micro Metrics
Downloads
11
Readme
AB Test
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 havemetricsEndpoint
defined on thewindow
object.session
:data-module-session-id
as an option or havemetricsSession
defined on thewindow
object.