2.0.0 • Published 7 years ago
@firstandthird/ab-test v2.0.0
AB Test 
Simple A/B Testing library using Domodule and Micro Metrics
Installation
npm install @firstandthird/ab-testUsage
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-urlas an option or havemetricsEndpointdefined on thewindowobject.session:data-module-session-idas an option or havemetricsSessiondefined on thewindowobject.